Theory AOT_PLM

1(*<*)
2theory AOT_PLM
3  imports AOT_axioms
4begin
5(*>*)
6
7section‹The Deductive System PLM›
8
9(* constrain sledgehammer to the abstraction layer *)
10unbundle AOT_no_atp
11
12(* To enable meta syntax: *)
13(*interpretation AOT_meta_syntax.*)
14(* To disable meta syntax: *)
15interpretation AOT_no_meta_syntax.
16
17(* To enable AOT syntax (takes precedence over meta syntax; can be done locally using "including" or "include"): *)
18unbundle AOT_syntax
19(* To disable AOT syntax (restoring meta syntax or no syntax; can be done locally using "including" or "include"): *)
20(* unbundle AOT_no_syntax *)
21
22AOT_theorem "modus-ponens": assumes φ and φ  ψ shows ψ
23  using assms by (simp add: AOT_sem_imp) (* NOTE: semantics needed *)
24lemmas MP = "modus-ponens"
25
26AOT_theorem "non-con-thm-thm": assumes  φ shows  φ
27  using assms by simp
28
29AOT_theorem "vdash-properties:1[1]": assumes φ  Λ shows  φ
30  using assms unfolding AOT_model_act_axiom_def by blast (* NOTE: semantics needed *)
31
32attribute_setup act_axiom_inst =
33  ‹Scan.succeed (Thm.rule_attribute [] (K (fn thm => thm RS @{thm "vdash-properties:1[1]"})))
34  "Instantiate modally fragile axiom as modally fragile theorem."
35
36AOT_theorem "vdash-properties:1[2]": assumes φ  Λ shows  φ
37  using assms unfolding AOT_model_axiom_def by blast (* NOTE: semantics needed *)
38
39attribute_setup axiom_inst =
40  ‹Scan.succeed (Thm.rule_attribute [] (K (fn thm => thm RS @{thm "vdash-properties:1[2]"})))
41  "Instantiate axiom as theorem."
42
43method cqt_2_lambda_inst_prover = (fast intro: AOT_instance_of_cqt_2_intro)
44method "cqt:2[lambda]" = (rule "cqt:2[lambda]"[axiom_inst]; cqt_2_lambda_inst_prover)
45lemmas "cqt:2" = "cqt:2[const_var]"[axiom_inst] "cqt:2[lambda]"[axiom_inst] AOT_instance_of_cqt_2_intro
46method "cqt:2" = (safe intro!: "cqt:2")
47
48AOT_theorem "vdash-properties:3": assumes  φ shows Γ  φ
49  using assms by blast
50
51AOT_theorem "vdash-properties:5": assumes Γ1  φ and Γ2  φ  ψ shows Γ1, Γ2  ψ
52  using MP assms by blast
53
54AOT_theorem "vdash-properties:6": assumes φ and φ  ψ shows ψ
55  using MP assms by blast
56
57AOT_theorem "vdash-properties:8": assumes Γ  φ and φ  ψ shows Γ  ψ
58  using assms by argo
59
60AOT_theorem "vdash-properties:9": assumes φ shows ψ  φ
61  using MP "pl:1"[axiom_inst] assms by blast
62
63AOT_theorem "vdash-properties:10": assumes φ  ψ and φ shows ψ
64  using MP assms by blast
65lemmas "→E" = "vdash-properties:10"
66
67AOT_theorem "rule-gen": assumes for arbitrary α: φ{α} shows α φ{α}
68  using assms by (metis AOT_var_of_term_inverse AOT_sem_denotes AOT_sem_forall) (* NOTE: semantics needed *)
69lemmas GEN = "rule-gen"
70
71AOT_theorem "RN[prem]": assumes Γ  φ shows Γ  φ
72  by (meson AOT_sem_box assms image_iff) (* NOTE: semantics needed *)
73AOT_theorem RN: assumes  φ shows φ
74  using "RN[prem]" assms by blast
75
76AOT_axiom "df-rules-formulas[1]": assumes φ df ψ shows φ  ψ
77  using assms by (simp_all add: AOT_model_axiomI AOT_model_equiv_def AOT_sem_imp) (* NOTE: semantics needed *)
78AOT_axiom "df-rules-formulas[2]": assumes φ df ψ shows ψ  φ
79  using assms by (simp_all add: AOT_model_axiomI AOT_model_equiv_def AOT_sem_imp) (* NOTE: semantics needed *)
80(* NOTE: for convenience also state the above as regular theorems *)
81AOT_theorem "df-rules-formulas[3]": assumes φ df ψ shows φ  ψ
82  using "df-rules-formulas[1]"[axiom_inst, OF assms].
83AOT_theorem "df-rules-formulas[4]": assumes φ df ψ shows ψ  φ
84  using "df-rules-formulas[2]"[axiom_inst, OF assms].
85
86
87AOT_axiom "df-rules-terms[1]":
88  assumes τ{α1...αn} =df σ{α1...αn}
89  shows (σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}) & (¬σ{τ1...τn}  ¬τ{τ1...τn})
90  using assms by (simp add: AOT_model_axiomI AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
91AOT_axiom "df-rules-terms[2]":
92  assumes τ =df σ
93  shows (σ  τ = σ) & (¬σ  ¬τ)
94  by (metis "df-rules-terms[1]" case_unit_Unity assms)
95(* NOTE: for convenience also state the above as regular theorems *)
96AOT_theorem "df-rules-terms[3]":
97  assumes τ{α1...αn} =df σ{α1...αn}
98  shows (σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}) & (¬σ{τ1...τn}  ¬τ{τ1...τn})
99  using "df-rules-terms[1]"[axiom_inst, OF assms].
100AOT_theorem "df-rules-terms[4]":
101  assumes τ =df σ
102  shows (σ  τ = σ) & (¬σ  ¬τ)
103  using "df-rules-terms[2]"[axiom_inst, OF assms].
104
105
106AOT_theorem "if-p-then-p": φ  φ
107  by (meson "pl:1"[axiom_inst] "pl:2"[axiom_inst] MP)
108
109AOT_theorem "deduction-theorem": assumes φ  ψ shows φ  ψ
110  using assms by (simp add: AOT_sem_imp) (* NOTE: semantics needed *)
111lemmas CP = "deduction-theorem"
112lemmas "→I" = "deduction-theorem"
113
114AOT_theorem "ded-thm-cor:1": assumes Γ1  φ  ψ and Γ2  ψ  χ shows Γ1, Γ2  φ  χ
115  using "→E" "→I" assms by blast
116AOT_theorem "ded-thm-cor:2": assumes Γ1  φ  (ψ  χ) and Γ2  ψ shows Γ1, Γ2  φ  χ
117  using "→E" "→I" assms by blast
118
119AOT_theorem "ded-thm-cor:3": assumes φ  ψ and ψ  χ shows φ  χ
120  using "→E" "→I" assms by blast
121declare "ded-thm-cor:3"[trans]
122AOT_theorem "ded-thm-cor:4": assumes φ  (ψ  χ) and ψ shows φ  χ
123  using "→E" "→I" assms by blast
124
125lemmas "Hypothetical Syllogism" = "ded-thm-cor:3"
126
127AOT_theorem "useful-tautologies:1": ¬¬φ  φ
128  by (metis "pl:3"[axiom_inst] "→I" "Hypothetical Syllogism")
129AOT_theorem "useful-tautologies:2": φ  ¬¬φ
130  by (metis "pl:3"[axiom_inst] "→I" "ded-thm-cor:4")
131AOT_theorem "useful-tautologies:3": ¬φ  (φ  ψ)
132  by (meson "ded-thm-cor:4" "pl:3"[axiom_inst] "→I")
133AOT_theorem "useful-tautologies:4": (¬ψ  ¬φ)  (φ  ψ)
134  by (meson "pl:3"[axiom_inst] "Hypothetical Syllogism" "→I")
135AOT_theorem "useful-tautologies:5": (φ  ψ)  (¬ψ  ¬φ)
136  by (metis "useful-tautologies:4" "Hypothetical Syllogism" "→I")
137
138AOT_theorem "useful-tautologies:6": (φ  ¬ψ)  (ψ  ¬φ)
139  by (metis "→I" MP "useful-tautologies:4")
140
141AOT_theorem "useful-tautologies:7": (¬φ  ψ)  (¬ψ  φ)
142  by (metis "→I" MP "useful-tautologies:3" "useful-tautologies:5")
143
144AOT_theorem "useful-tautologies:8": φ  (¬ψ  ¬(φ  ψ))
145  by (metis "→I" MP "useful-tautologies:5")
146
147AOT_theorem "useful-tautologies:9": (φ  ψ)  ((¬φ  ψ)  ψ)
148  by (metis "→I" MP "useful-tautologies:6")
149
150AOT_theorem "useful-tautologies:10": (φ  ¬ψ)  ((φ  ψ)  ¬φ)
151  by (metis "→I" MP "pl:3"[axiom_inst])
152
153AOT_theorem "dn-i-e:1": assumes φ shows ¬¬φ
154  using MP "useful-tautologies:2" assms by blast
155lemmas "¬¬I" = "dn-i-e:1"
156AOT_theorem "dn-i-e:2": assumes ¬¬φ shows φ
157  using MP "useful-tautologies:1" assms by blast
158lemmas "¬¬E" = "dn-i-e:2"
159
160AOT_theorem "modus-tollens:1": assumes φ  ψ and ¬ψ shows ¬φ
161  using MP "useful-tautologies:5" assms by blast
162AOT_theorem "modus-tollens:2": assumes φ  ¬ψ and ψ shows ¬φ
163  using "¬¬I" "modus-tollens:1" assms by blast
164lemmas MT = "modus-tollens:1" "modus-tollens:2"
165
166AOT_theorem "contraposition:1[1]": assumes φ  ψ shows ¬ψ  ¬φ
167  using "→I" MT(1) assms by blast
168AOT_theorem "contraposition:1[2]": assumes ¬ψ  ¬φ shows φ  ψ
169  using "→I" "¬¬E" MT(2) assms by blast
170
171AOT_theorem "contraposition:2": assumes φ  ¬ψ shows ψ  ¬φ
172  using "→I" MT(2) assms by blast
173
174(* TODO: this is actually a mixture of the two variants given in PLM; adjust. *)
175AOT_theorem "reductio-aa:1":
176  assumes ¬φ  ¬ψ and ¬φ  ψ shows φ
177  using "→I" "¬¬E" MT(2) assms by blast
178AOT_theorem "reductio-aa:2":
179  assumes φ  ¬ψ and φ  ψ shows ¬φ
180  using "reductio-aa:1" assms by blast
181lemmas "RAA" = "reductio-aa:1" "reductio-aa:2"
182
183AOT_theorem "exc-mid": φ  ¬φ
184  using "df-rules-formulas[4]" "if-p-then-p" MP "conventions:2" by blast
185
186AOT_theorem "non-contradiction": ¬(φ & ¬φ)
187  using "df-rules-formulas[3]" MT(2) "useful-tautologies:2" "conventions:1" by blast
188
189AOT_theorem "con-dis-taut:1": (φ & ψ)  φ
190  by (meson "→I" "df-rules-formulas[3]" MP RAA(1) "conventions:1")
191AOT_theorem "con-dis-taut:2": (φ & ψ)  ψ
192  by (metis "→I" "df-rules-formulas[3]" MT(2) RAA(2) "¬¬E" "conventions:1")
193lemmas "Conjunction Simplification" = "con-dis-taut:1" "con-dis-taut:2"
194
195AOT_theorem "con-dis-taut:3": φ  (φ  ψ)
196  by (meson "contraposition:1[2]" "df-rules-formulas[4]" MP "→I" "conventions:2")
197AOT_theorem "con-dis-taut:4": ψ  (φ  ψ)
198  using "Hypothetical Syllogism" "df-rules-formulas[4]" "pl:1"[axiom_inst] "conventions:2" by blast
199lemmas "Disjunction Addition" = "con-dis-taut:3" "con-dis-taut:4"
200
201AOT_theorem "con-dis-taut:5": φ  (ψ  (φ & ψ))
202  by (metis "contraposition:2" "Hypothetical Syllogism" "→I" "df-rules-formulas[4]" "conventions:1")
203lemmas Adjunction = "con-dis-taut:5"
204
205AOT_theorem "con-dis-taut:6": (φ & φ)  φ
206  by (metis Adjunction "→I" "df-rules-formulas[4]" MP "Conjunction Simplification"(1) "conventions:3")
207lemmas "Idempotence of &" = "con-dis-taut:6"
208
209AOT_theorem "con-dis-taut:7": (φ  φ)  φ
210proof -
211  {
212    AOT_assume φ  φ
213    AOT_hence ¬φ  φ
214      using "conventions:2"[THEN "df-rules-formulas[3]"] MP by blast
215    AOT_hence φ using "if-p-then-p" RAA(1) MP by blast
216  }
217  moreover {
218    AOT_assume φ
219    AOT_hence φ  φ using "Disjunction Addition"(1) MP by blast
220  }
221  ultimately AOT_show (φ  φ)  φ
222    using "conventions:3"[THEN "df-rules-formulas[4]"] MP
223    by (metis Adjunction "→I")
224qed
225lemmas "Idempotence of ∨" = "con-dis-taut:7"
226
227
228AOT_theorem "con-dis-i-e:1": assumes φ and ψ shows φ & ψ
229  using Adjunction MP assms by blast
230lemmas "&I" = "con-dis-i-e:1"
231
232AOT_theorem "con-dis-i-e:2:a": assumes φ & ψ shows φ
233  using "Conjunction Simplification"(1) MP assms by blast
234AOT_theorem "con-dis-i-e:2:b": assumes φ & ψ shows ψ
235  using "Conjunction Simplification"(2) MP assms by blast
236lemmas "&E" = "con-dis-i-e:2:a" "con-dis-i-e:2:b"
237
238AOT_theorem "con-dis-i-e:3:a": assumes φ shows φ  ψ
239  using "Disjunction Addition"(1) MP assms by blast
240AOT_theorem "con-dis-i-e:3:b": assumes ψ shows φ  ψ
241  using "Disjunction Addition"(2) MP assms by blast
242AOT_theorem "con-dis-i-e:3:c": assumes φ  ψ and φ  χ and ψ  Θ shows χ  Θ
243  by (metis "con-dis-i-e:3:a" "Disjunction Addition"(2) "df-rules-formulas[3]" MT(1) RAA(1) "conventions:2" assms)
244lemmas "∨I" = "con-dis-i-e:3:a" "con-dis-i-e:3:b" "con-dis-i-e:3:c"
245
246AOT_theorem "con-dis-i-e:4:a": assumes φ  ψ and φ  χ and ψ  χ shows χ
247  by (metis MP RAA(2) "df-rules-formulas[3]" "conventions:2" assms)
248AOT_theorem "con-dis-i-e:4:b": assumes φ  ψ and ¬φ shows ψ
249  using "con-dis-i-e:4:a" RAA(1) "→I" assms by blast
250AOT_theorem "con-dis-i-e:4:c": assumes φ  ψ and ¬ψ shows φ
251  using "con-dis-i-e:4:a" RAA(1) "→I" assms by blast
252lemmas "∨E" = "con-dis-i-e:4:a" "con-dis-i-e:4:b" "con-dis-i-e:4:c"
253
254AOT_theorem "raa-cor:1": assumes ¬φ  ψ & ¬ψ shows φ
255  using "&E" "∨E"(3) "∨I"(2) RAA(2) assms by blast
256AOT_theorem "raa-cor:2": assumes φ  ψ & ¬ψ shows ¬φ
257  using "raa-cor:1" assms by blast
258AOT_theorem "raa-cor:3": assumes φ and ¬ψ  ¬φ shows ψ
259  using RAA assms by blast
260AOT_theorem "raa-cor:4": assumes ¬φ and ¬ψ  φ shows ψ
261  using RAA assms by blast
262AOT_theorem "raa-cor:5": assumes φ and ψ  ¬φ shows ¬ψ
263  using RAA assms by blast
264AOT_theorem "raa-cor:6": assumes ¬φ and ψ  φ shows ¬ψ
265  using RAA assms by blast
266
267(* TODO: note these need manual introduction rules *)
268AOT_theorem "oth-class-taut:1:a": (φ  ψ)  ¬(φ & ¬ψ)
269  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
270     (metis "&E" "&I" "raa-cor:3" "→I" MP)
271AOT_theorem "oth-class-taut:1:b": ¬(φ  ψ)  (φ & ¬ψ)
272  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
273     (metis "&E" "&I" "raa-cor:3" "→I" MP)
274AOT_theorem "oth-class-taut:1:c": (φ  ψ)  (¬φ  ψ)
275  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
276     (metis "&I" "∨I"(1, 2) "∨E"(3) "→I" MP "raa-cor:1")
277
278AOT_theorem "oth-class-taut:2:a": (φ & ψ)  (ψ & φ)
279  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
280     (meson "&I" "&E" "→I")
281lemmas "Commutativity of &" = "oth-class-taut:2:a"
282AOT_theorem "oth-class-taut:2:b": (φ & (ψ & χ))  ((φ & ψ) & χ)
283  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
284     (metis "&I" "&E" "→I")
285lemmas "Associativity of &" = "oth-class-taut:2:b"
286AOT_theorem "oth-class-taut:2:c": (φ  ψ)  (ψ  φ)
287  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
288     (metis "&I" "∨I"(1, 2) "∨E"(1) "→I")
289lemmas "Commutativity of ∨" = "oth-class-taut:2:c"
290AOT_theorem "oth-class-taut:2:d": (φ  (ψ  χ))  ((φ  ψ)  χ)
291  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
292     (metis "&I" "∨I"(1, 2) "∨E"(1) "→I")
293lemmas "Associativity of ∨" = "oth-class-taut:2:d"
294AOT_theorem "oth-class-taut:2:e": (φ  ψ)  (ψ  φ)
295  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"]; rule "&I";
296      metis "&I" "df-rules-formulas[4]" "conventions:3" "&E" "Hypothetical Syllogism" "→I" "df-rules-formulas[3]")
297lemmas "Commutativity of ≡" = "oth-class-taut:2:e"
298AOT_theorem "oth-class-taut:2:f": (φ  (ψ  χ))  ((φ  ψ)  χ)
299  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
300        "→I" "→E" "&E" "&I"
301  by metis
302lemmas "Associativity of ≡" = "oth-class-taut:2:f"
303
304AOT_theorem "oth-class-taut:3:a": φ  φ
305  using "&I" "vdash-properties:6" "if-p-then-p" "df-rules-formulas[4]" "conventions:3" by blast
306AOT_theorem "oth-class-taut:3:b": φ  ¬¬φ
307  using "&I" "useful-tautologies:1" "useful-tautologies:2" "vdash-properties:6" "df-rules-formulas[4]" "conventions:3" by blast
308AOT_theorem "oth-class-taut:3:c": ¬(φ  ¬φ)
309  by (metis "&E" "→E" RAA "df-rules-formulas[3]" "conventions:3")
310
311AOT_theorem "oth-class-taut:4:a": (φ  ψ)  ((ψ  χ)  (φ  χ))
312  by (metis "→E" "→I")
313AOT_theorem "oth-class-taut:4:b": (φ  ψ)  (¬φ  ¬ψ)
314  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
315        "→I" "→E" "&E" "&I" RAA by metis
316AOT_theorem "oth-class-taut:4:c": (φ  ψ)  ((φ  χ)  (ψ  χ))
317  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
318        "→I" "→E" "&E" "&I" by metis
319AOT_theorem "oth-class-taut:4:d": (φ  ψ)  ((χ  φ)  (χ  ψ))
320  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
321        "→I" "→E" "&E" "&I" by metis
322AOT_theorem "oth-class-taut:4:e": (φ  ψ)  ((φ & χ)  (ψ & χ))
323  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
324        "→I" "→E" "&E" "&I" by metis
325AOT_theorem "oth-class-taut:4:f": (φ  ψ)  ((χ & φ)  (χ & ψ))
326  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
327        "→I" "→E" "&E" "&I" by metis
328(* TODO: nicer proof *)
329AOT_theorem "oth-class-taut:4:g": (φ  ψ)  ((φ & ψ)  (¬φ & ¬ψ))
330  apply (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"]; rule "&I"; rule "→I")
331   apply (drule "conventions:3"[THEN "df-rules-formulas[3]", THEN "→E"])
332   apply (metis "&I" "&E" "∨I"(1,2) MT(1) "raa-cor:3")
333  apply (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"]; rule "&I"; rule "→I")
334  using "&E" "∨E"(2) "raa-cor:3" by blast+
335AOT_theorem "oth-class-taut:4:h": ¬(φ  ψ)  ((φ & ¬ψ)  (¬φ & ψ))
336  apply (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"]; rule "&I"; rule "→I")
337  apply (metis "&I" "∨I"(1, 2) "→I" MT(1) "df-rules-formulas[4]" "raa-cor:3" "conventions:3")
338  by (metis "&E" "∨E"(2) "→E" "df-rules-formulas[3]" "raa-cor:3" "conventions:3")
339AOT_theorem "oth-class-taut:5:a": (φ & ψ)  ¬(¬φ  ¬ψ)
340  using "conventions:3"[THEN "df-rules-formulas[4]"]
341        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
342AOT_theorem "oth-class-taut:5:b": (φ  ψ)  ¬(¬φ & ¬ψ)
343  using "conventions:3"[THEN "df-rules-formulas[4]"]
344        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
345AOT_theorem "oth-class-taut:5:c": ¬(φ & ψ)  (¬φ  ¬ψ)
346  using "conventions:3"[THEN "df-rules-formulas[4]"]
347        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
348AOT_theorem "oth-class-taut:5:d": ¬(φ  ψ)  (¬φ & ¬ψ)
349  using "conventions:3"[THEN "df-rules-formulas[4]"]
350        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
351
352lemmas DeMorgan = "oth-class-taut:5:c" "oth-class-taut:5:d"
353
354AOT_theorem "oth-class-taut:6:a": (φ & (ψ  χ))  ((φ & ψ)  (φ & χ))
355  using "conventions:3"[THEN "df-rules-formulas[4]"]
356        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
357AOT_theorem "oth-class-taut:6:b": (φ  (ψ & χ))  ((φ  ψ) & (φ  χ))
358  using "conventions:3"[THEN "df-rules-formulas[4]"]
359        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
360
361AOT_theorem "oth-class-taut:7:a": ((φ & ψ)  χ)  (φ  (ψ  χ))
362  by (metis "&I" "→E" "→I")
363lemmas Exportation = "oth-class-taut:7:a"
364AOT_theorem "oth-class-taut:7:b": (φ  (ψ χ))  ((φ & ψ)  χ)
365  by (metis "&E" "→E" "→I")
366lemmas Importation = "oth-class-taut:7:b"
367
368AOT_theorem "oth-class-taut:8:a": (φ  (ψ  χ))  (ψ  (φ  χ))
369  using "conventions:3"[THEN "df-rules-formulas[4]"] "→I" "→E" "&E" "&I" by metis
370lemmas Permutation = "oth-class-taut:8:a"
371AOT_theorem "oth-class-taut:8:b": (φ  ψ)  ((φ  χ)  (φ  (ψ & χ)))
372  by (metis "&I" "→E" "→I")
373lemmas Composition = "oth-class-taut:8:b"
374AOT_theorem "oth-class-taut:8:c": (φ  χ)  ((ψ  χ)  ((φ  ψ)  χ))
375  by (metis "∨E"(2) "→E" "→I" RAA(1))
376AOT_theorem "oth-class-taut:8:d": ((φ  ψ) & (χ  Θ))  ((φ & χ)  (ψ & Θ))
377  by (metis "&E" "&I" "→E" "→I")
378lemmas "Double Composition" = "oth-class-taut:8:d"
379AOT_theorem "oth-class-taut:8:e": ((φ & ψ)  (φ & χ))  (φ  (ψ  χ))
380  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
381            "→I" "→E" "&E" "&I")
382AOT_theorem "oth-class-taut:8:f": ((φ & ψ)  (χ & ψ))  (ψ  (φ  χ))
383  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
384            "→I" "→E" "&E" "&I")
385AOT_theorem "oth-class-taut:8:g": (ψ  χ)  ((φ  ψ)  (φ  χ))
386  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
387            "→I" "→E" "&E" "&I" "∨I" "∨E"(1))
388AOT_theorem "oth-class-taut:8:h": (ψ  χ)  ((ψ  φ)  (χ  φ))
389  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
390            "→I" "→E" "&E" "&I" "∨I" "∨E"(1))
391AOT_theorem "oth-class-taut:8:i": (φ  (ψ & χ))  (ψ  (φ  χ))
392  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
393            "→I" "→E" "&E" "&I")
394
395AOT_theorem "intro-elim:1": assumes φ  ψ and φ  χ and ψ  Θ shows χ  Θ
396  by (metis assms "∨I"(1, 2) "∨E"(1) "conventions:3"[THEN "df-rules-formulas[3]"] "→I" "→E" "&E"(1))
397
398AOT_theorem "intro-elim:2": assumes φ  ψ and ψ  φ shows φ  ψ
399  by (meson "&I" "conventions:3" "df-rules-formulas[4]" MP assms)
400lemmas "≡I" = "intro-elim:2"
401
402AOT_theorem "intro-elim:3:a": assumes φ  ψ and φ shows ψ
403  by (metis "∨I"(1) "→I" "∨E"(1) "intro-elim:1" assms)
404AOT_theorem "intro-elim:3:b": assumes φ  ψ and ψ shows φ
405  using "intro-elim:3:a" "Commutativity of ≡" assms by blast
406AOT_theorem "intro-elim:3:c": assumes φ  ψ and ¬φ shows ¬ψ
407  using "intro-elim:3:b" "raa-cor:3" assms by blast
408AOT_theorem "intro-elim:3:d": assumes φ  ψ and ¬ψ shows ¬φ
409  using "intro-elim:3:a" "raa-cor:3" assms by blast
410AOT_theorem "intro-elim:3:e": assumes φ  ψ and ψ  χ shows φ  χ
411  by (metis "≡I" "→I" "intro-elim:3:a" "intro-elim:3:b" assms)
412declare "intro-elim:3:e"[trans]
413AOT_theorem "intro-elim:3:f": assumes φ  ψ and φ  χ shows χ  ψ
414  by (metis "≡I" "→I" "intro-elim:3:a" "intro-elim:3:b" assms)
415lemmas "≡E" = "intro-elim:3:a" "intro-elim:3:b" "intro-elim:3:c" "intro-elim:3:d" "intro-elim:3:e" "intro-elim:3:f"
416
417declare "Commutativity of ≡"[THEN "≡E"(1), sym]
418
419AOT_theorem "rule-eq-df:1": assumes φ df ψ shows φ  ψ
420  by (simp add: "≡I" "df-rules-formulas[3]" "df-rules-formulas[4]" assms)
421lemmas "≡Df" = "rule-eq-df:1"
422AOT_theorem "rule-eq-df:2": assumes φ df ψ and φ shows ψ
423  using "≡Df" "≡E"(1) assms by blast
424lemmas "≡dfE" = "rule-eq-df:2"
425AOT_theorem "rule-eq-df:3": assumes φ df ψ and ψ shows φ
426  using "≡Df" "≡E"(2) assms by blast
427lemmas "≡dfI" = "rule-eq-df:3"
428
429AOT_theorem  "df-simplify:1": assumes φ  (ψ & χ) and ψ shows φ  χ
430  by (metis "&E"(2) "&I" "≡E"(1, 2) "≡I" "→I" assms)
431(* TODO: this is a slight variation from PLM *)
432AOT_theorem  "df-simplify:2": assumes φ  (ψ & χ) and χ shows φ  ψ
433  by (metis "&E"(1) "&I" "≡E"(1, 2) "≡I" "→I" assms)
434lemmas "≡S" = "df-simplify:1"  "df-simplify:2"
435
436AOT_theorem "rule-ui:1": assumes α φ{α} and τ shows φ{τ}
437  using "→E" "cqt:1"[axiom_inst] assms by blast
438AOT_theorem "rule-ui:2[const_var]": assumes α φ{α} shows φ{β}
439  by (simp add: "rule-ui:1" "cqt:2[const_var]"[axiom_inst] assms)
440(* TODO: precise proviso in PLM *)
441AOT_theorem "rule-ui:2[lambda]":
442  assumes F φ{F} and INSTANCE_OF_CQT_2(ψ)
443  shows φ{ν1...νn ψ{ν1...νn}]}
444  by (simp add: "rule-ui:1" "cqt:2[lambda]"[axiom_inst] assms)
445AOT_theorem "rule-ui:3": assumes α φ{α} shows φ{α}
446  by (simp add: "rule-ui:2[const_var]" assms)
447lemmas "∀E" = "rule-ui:1" "rule-ui:2[const_var]" "rule-ui:2[lambda]" "rule-ui:3"
448
449AOT_theorem "cqt-orig:1[const_var]": α φ{α}  φ{β} by (simp add: "∀E"(2) "→I")
450AOT_theorem "cqt-orig:1[lambda]":
451  assumes INSTANCE_OF_CQT_2(ψ)
452  shows F φ{F}  φ{ν1...νn ψ{ν1...νn}]}
453  by (simp add: "∀E"(3) "→I" assms)
454AOT_theorem "cqt-orig:2": α (φ  ψ{α})  (φ  α ψ{α})
455  by (metis "→I" GEN "vdash-properties:6" "∀E"(4))
456AOT_theorem "cqt-orig:3": α φ{α}  φ{α} using "cqt-orig:1[const_var]" .
457
458(* TODO: work out difference to GEN *)
459AOT_theorem universal: assumes for arbitrary β: φ{β} shows α φ{α}
460  using GEN assms .
461lemmas "∀I" = universal
462
463(* Generalized mechanism for "∀I" followed by ∀E *)
464ML465fun get_instantiated_allI ctxt varname thm = let
466val trm = Thm.concl_of thm
467val trm = case trm of (@{const Trueprop} $ (@{const AOT_model_valid_in} $ _ $ x)) => x
468                      | _ => raise Term.TERM ("Expected simple theorem.", [trm])
469fun extractVars (Const (const_name‹AOT_term_of_var›, _) $ Var v) =
470    (if fst (fst v) = fst varname then [Var v] else []) (* TODO: care about the index? *)
471  | extractVars (t1 $ t2) = extractVars t1 @ extractVars t2
472  | extractVars (Abs (_, _, t)) = extractVars t
473  | extractVars _ = []
474val vars = extractVars trm
475val vars = fold Term.add_vars vars []
476val var = hd vars
477val trmty = case (snd var) of (Type (type_name‹AOT_var›, [t])) => (t)
478              | _ => raise Term.TYPE ("Expected variable type.", [snd var], [Var var])
479val trm = Abs (Term.string_of_vname (fst var), trmty, Term.abstract_over (
480      Const (const_name‹AOT_term_of_var›, Type ("fun", [snd var, trmty]))
481       $ Var var, trm))
482val trm = Thm.cterm_of (Context.proof_of ctxt) trm
483val ty = hd (Term.add_tvars (Thm.prop_of @{thm "∀I"}) [])
484val typ = Thm.ctyp_of (Context.proof_of ctxt) trmty
485val allthm = Drule.instantiate_normalize ([(ty, typ)],[]) @{thm "∀I"}
486val phi = hd (Term.add_vars (Thm.prop_of allthm) [])
487val allthm = Drule.instantiate_normalize ([],[(phi,trm)]) allthm
488in
489allthm
490end
491
492
493attribute_setup "∀I" =
494  ‹Scan.lift (Scan.repeat1 Args.var) >> (fn args => Thm.rule_attribute []
495  (fn ctxt => fn thm => fold (fn arg => fn thm => thm RS get_instantiated_allI ctxt arg thm) args thm))
496  "Quantify over a variable in a theorem using GEN."
497
498attribute_setup "unvarify" =
499  ‹Scan.lift (Scan.repeat1 Args.var) >> (fn args => Thm.rule_attribute []
500  (fn ctxt => fn thm =>
501    let
502    val thm = fold (fn arg => fn thm => thm RS get_instantiated_allI ctxt arg thm) args thm
503    val thm = fold (fn _ => fn thm => thm RS @{thm "∀E"(1)}) args thm
504    in
505     thm
506    end))
507  "Generalize a statement about variables to a statement about denoting terms."
508
509(* TODO: rereplace-lem does not apply to the embedding *)
510
511AOT_theorem "cqt-basic:1": αβ φ{α,β}  βα φ{α,β}
512  by (metis "≡I" "∀E"(2) "∀I" "→I")
513
514AOT_theorem "cqt-basic:2": α(φ{α}  ψ{α})  (α(φ{α}  ψ{α}) & α(ψ{α}  φ{α}))
515proof (rule "≡I"; rule "→I")
516  AOT_assume α(φ{α}  ψ{α})
517  AOT_hence φ{α}  ψ{α} for α using "∀E"(2) by blast
518  AOT_hence φ{α}  ψ{α} and ψ{α}  φ{α} for α
519    using "≡E"(1,2) "→I" by blast+
520  AOT_thus α(φ{α}  ψ{α}) & α(ψ{α}  φ{α})
521    by (auto intro: "&I" "∀I")
522next
523  AOT_assume α(φ{α}  ψ{α}) & α(ψ{α}  φ{α})
524  AOT_hence φ{α}  ψ{α} and ψ{α}  φ{α} for α
525    using "∀E"(2) "&E" by blast+
526  AOT_hence φ{α}  ψ{α} for α
527    using "≡I" by blast
528  AOT_thus α(φ{α}  ψ{α}) by (auto intro: "∀I")
529qed
530
531AOT_theorem "cqt-basic:3": α(φ{α}  ψ{α})  (α φ{α}  α ψ{α})
532proof(rule "→I")
533  AOT_assume α(φ{α}  ψ{α})
534  AOT_hence 1: φ{α}  ψ{α} for α using "∀E"(2) by blast
535  {
536    AOT_assume α φ{α}
537    AOT_hence α ψ{α} using 1 "∀I" "∀E"(4) "≡E" by metis
538  }
539  moreover {
540    AOT_assume α ψ{α}
541    AOT_hence α φ{α} using 1 "∀I" "∀E"(4) "≡E" by metis
542  }
543  ultimately AOT_show α φ{α}  α ψ{α}
544    using "≡I" "→I" by auto
545qed
546
547AOT_theorem "cqt-basic:4": α(φ{α} & ψ{α})  (α φ{α} & α ψ{α})
548proof(rule "→I")
549  AOT_assume 0: α(φ{α} & ψ{α})
550  AOT_have φ{α} and ψ{α} for α using "∀E"(2) 0 "&E" by blast+
551  AOT_thus α φ{α} & α ψ{α}
552    by (auto intro: "∀I" "&I")
553qed
554
555AOT_theorem "cqt-basic:5": (α1...∀αn(φ{α1...αn}))  φ{α1...αn}
556  using "cqt-orig:3" by blast
557
558AOT_theorem "cqt-basic:6": αα φ{α}  α φ{α}
559  by (meson "≡I" "→I" GEN "cqt-orig:1[const_var]")
560
561AOT_theorem "cqt-basic:7": (φ  α ψ{α})  α(φ  ψ{α})
562  by (metis "→I" "vdash-properties:6" "rule-ui:3" "≡I" GEN)
563
564AOT_theorem "cqt-basic:8": (α φ{α}  α ψ{α})  α (φ{α}  ψ{α})
565  by (simp add: "∨I"(3) "→I" GEN "cqt-orig:1[const_var]")
566
567AOT_theorem "cqt-basic:9": (α (φ{α}  ψ{α}) & α (ψ{α}  χ{α}))  α(φ{α}  χ{α})
568proof -
569  {
570    AOT_assume α (φ{α}  ψ{α})
571    moreover AOT_assume α (ψ{α}  χ{α})
572    ultimately AOT_have φ{α}  ψ{α} and ψ{α}  χ{α} for α using "∀E" by blast+
573    AOT_hence φ{α}  χ{α} for α by (metis "→E" "→I")
574    AOT_hence α(φ{α}  χ{α}) using "∀I" by fast
575  }
576  thus ?thesis using "&I" "→I" "&E" by meson
577qed
578
579AOT_theorem "cqt-basic:10": (α(φ{α}  ψ{α}) & α(ψ{α}  χ{α}))  α (φ{α}  χ{α})
580proof(rule "→I"; rule "∀I")
581  fix β
582  AOT_assume α(φ{α}  ψ{α}) & α(ψ{α}  χ{α})
583  AOT_hence φ{β}  ψ{β} and ψ{β}  χ{β} using "&E" "∀E" by blast+
584  AOT_thus φ{β}  χ{β} using "≡I" "≡E" by blast
585qed
586
587AOT_theorem "cqt-basic:11": α(φ{α}  ψ{α})  α (ψ{α}  φ{α})
588proof (rule "≡I"; rule "→I")
589  AOT_assume 0: α(φ{α}  ψ{α})
590  {
591    fix α
592    AOT_have φ{α}  ψ{α} using 0 "∀E" by blast
593    AOT_hence ψ{α}  φ{α} using "≡I" "≡E" "→I" "→E" by metis
594  }
595  AOT_thus α(ψ{α}  φ{α}) using "∀I" by fast
596next
597  AOT_assume 0: α(ψ{α}  φ{α})
598  {
599    fix α
600    AOT_have ψ{α}  φ{α} using 0 "∀E" by blast
601    AOT_hence φ{α}  ψ{α} using "≡I" "≡E" "→I" "→E" by metis
602  }
603  AOT_thus α(φ{α}  ψ{α}) using "∀I" by fast
604qed
605
606AOT_theorem "cqt-basic:12": α φ{α}  α (ψ{α}  φ{α})
607  by (simp add: "∀E"(2) "→I" GEN)
608
609AOT_theorem "cqt-basic:13": α φ{α}  β φ{β}
610  using "≡I" "→I" by blast
611
612AOT_theorem "cqt-basic:14": (α1...∀αn (φ{α1...αn}  ψ{α1...αn}))  ((α1...∀αn φ{α1...αn})  (α1...∀αn ψ{α1...αn}))
613  using "cqt:3"[axiom_inst] by auto
614
615AOT_theorem "cqt-basic:15": (α1...∀αn (φ  ψ{α1...αn}))  (φ  (α1...∀αn ψ{α1...αn}))
616  using "cqt-orig:2" by auto
617
618(* TODO: once more the same in the embedding... need to distinguish these better *)
619AOT_theorem "universal-cor": assumes for arbitrary β: φ{β}  shows α φ{α}
620  using GEN assms .
621
622AOT_theorem "existential:1": assumes φ{τ} and τ shows α φ{α}
623proof(rule "raa-cor:1")
624  AOT_assume ¬α φ{α}
625  AOT_hence α ¬φ{α}
626    using "≡dfI" "conventions:4" RAA "&I" by blast
627  AOT_hence ¬φ{τ} using assms(2) "∀E"(1) "→E" by blast
628  AOT_thus φ{τ} & ¬φ{τ} using assms(1) "&I" by blast
629qed
630
631AOT_theorem "existential:2[const_var]": assumes φ{β} shows α φ{α}
632  using "existential:1" "cqt:2[const_var]"[axiom_inst] assms by blast
633
634AOT_theorem "existential:2[lambda]":
635  assumes φ{ν1...νn ψ{ν1...νn}]} and INSTANCE_OF_CQT_2(ψ)
636  shows α φ{α}
637  using "existential:1" "cqt:2[lambda]"[axiom_inst] assms by blast
638lemmas "∃I" = "existential:1" "existential:2[const_var]" "existential:2[lambda]" 
639
640AOT_theorem "instantiation":
641  assumes for arbitrary β: φ{β}  ψ and α φ{α}
642  shows ψ
643  by (metis (no_types, lifting) "≡dfE" GEN "raa-cor:3" "conventions:4" assms)
644lemmas "∃E" = "instantiation"
645
646AOT_theorem "cqt-further:1": α φ{α}  α φ{α}
647  using "∀E"(4) "∃I"(2) "→I" by metis
648
649AOT_theorem "cqt-further:2": ¬α φ{α}  α ¬φ{α}
650  using "∀I" "∃I"(2) "→I" RAA by metis
651
652AOT_theorem "cqt-further:3": α φ{α}  ¬α ¬φ{α}
653  using "∀E"(4) "∃E" "→I" RAA
654  by (metis "cqt-further:2" "≡I" "modus-tollens:1")
655
656AOT_theorem "cqt-further:4": ¬α φ{α}  α ¬φ{α}
657  using "∀I" "∃I"(2)"→I" RAA by metis
658
659AOT_theorem "cqt-further:5": α (φ{α} & ψ{α})  (α φ{α} & α ψ{α})
660  by (metis (no_types, lifting) "&E" "&I" "∃E" "∃I"(2) "→I")
661
662AOT_theorem "cqt-further:6": α (φ{α}  ψ{α})  (α φ{α}  α ψ{α})
663  by (metis (mono_tags, lifting) "∃E" "∃I"(2) "∨E"(3) "∨I"(1, 2) "→I" RAA(2))
664
665AOT_theorem "cqt-further:7": α φ{α}  β φ{β} (* TODO: vacuous in the embedding *)
666  by (simp add: "oth-class-taut:3:a")
667
668AOT_theorem "cqt-further:8": (α φ{α} & α ψ{α})  α (φ{α}  ψ{α})
669  by (metis (mono_tags, lifting) "&E" "≡I" "∀E"(2) "→I" GEN)
670
671AOT_theorem "cqt-further:9": (¬α φ{α} & ¬α ψ{α})  α (φ{α}  ψ{α})
672  by (metis (mono_tags, lifting) "&E" "≡I" "∃I"(2) "→I" GEN "raa-cor:4")
673
674AOT_theorem "cqt-further:10": (α φ{α} & ¬α ψ{α})  ¬α (φ{α}  ψ{α})
675proof(rule "→I"; rule "raa-cor:2")
676  AOT_assume 0: α φ{α} & ¬α ψ{α}
677  then AOT_obtain α where φ{α} using "∃E" "&E"(1) by metis
678  moreover AOT_assume α (φ{α}  ψ{α})
679  ultimately AOT_have ψ{α} using "∀E"(4) "≡E"(1) by blast
680  AOT_hence α ψ{α} using "∃I" by blast
681  AOT_thus α ψ{α} & ¬α ψ{α} using 0 "&E"(2) "&I" by blast
682qed
683
684AOT_theorem "cqt-further:11": αβ φ{α,β}  βα φ{α,β}
685  using "≡I" "→I" "∃I"(2) "∃E" by metis
686
687AOT_theorem "log-prop-prop:1":  φ]
688  using "cqt:2[lambda0]"[axiom_inst] by auto
689
690AOT_theorem "log-prop-prop:2": φ
691  by (rule "≡dfI"[OF "existence:3"]) "cqt:2[lambda]"
692
693AOT_theorem "exist-nec": τ  τ
694proof -
695  AOT_have β β
696    by (simp add: GEN RN "cqt:2[const_var]"[axiom_inst])
697  AOT_thus τ  τ
698    using "cqt:1"[axiom_inst] "→E" by blast
699qed
700
701(* TODO: replace this mechanism by a "proof by types" command *)
702class AOT_Term_id = AOT_Term +
703  assumes "t=t-proper:1"[AOT]: [v  τ = τ'  τ]
704      and "t=t-proper:2"[AOT]: [v  τ = τ'  τ']
705
706instance κ :: AOT_Term_id
707proof
708  AOT_modally_strict {
709    AOT_show κ = κ'  κ for κ κ'
710    proof(rule "→I")
711      AOT_assume κ = κ'
712      AOT_hence O!κ  A!κ
713        by (rule "∨I"(3)[OF "≡dfE"[OF "identity:1"]])
714           (meson "→I" "∨I"(1) "&E"(1))+
715      AOT_thus κ
716        by (rule "∨E"(1))
717           (metis "cqt:5:a"[axiom_inst] "→I" "→E" "&E"(2))+
718    qed
719  }
720next
721  AOT_modally_strict {
722    AOT_show κ = κ'  κ' for κ κ'
723    proof(rule "→I")
724      AOT_assume κ = κ'
725      AOT_hence O!κ'  A!κ'
726        by (rule "∨I"(3)[OF "≡dfE"[OF "identity:1"]])
727           (meson "→I" "∨I" "&E")+
728      AOT_thus κ'
729        by (rule "∨E"(1))
730           (metis "cqt:5:a"[axiom_inst] "→I" "→E" "&E"(2))+
731    qed
732  }
733qed
734
735instance rel :: (AOT_κs) AOT_Term_id
736proof
737  AOT_modally_strict {
738    AOT_show Π = Π'  Π for Π Π' :: <'a> (* TODO: how to get rid of the fixes? *)
739    proof(rule "→I")
740      AOT_assume Π = Π'
741      AOT_thus Π using "≡dfE"[OF "identity:3"[of Π Π']] "&E" by blast
742    qed
743  }
744next
745  AOT_modally_strict {
746    AOT_show Π = Π'  Π' for Π Π' :: <'a> (* TODO: how to get rid of the fixes? *)
747    proof(rule "→I")
748      AOT_assume Π = Π'
749      AOT_thus Π' using "≡dfE"[OF "identity:3"[of Π Π']] "&E" by blast
750    qed
751  }
752qed
753
754instance 𝗈 :: AOT_Term_id
755proof
756  AOT_modally_strict {
757    fix φ ψ
758    AOT_show φ = ψ  φ
759    proof(rule "→I")
760      AOT_assume φ = ψ
761      AOT_thus φ using "≡dfE"[OF "identity:4"[of φ ψ]] "&E" by blast
762    qed
763  }
764next
765  AOT_modally_strict {
766    fix φ ψ
767    AOT_show φ = ψ  ψ
768    proof(rule "→I")
769      AOT_assume φ = ψ
770      AOT_thus ψ using "≡dfE"[OF "identity:4"[of φ ψ]] "&E" by blast
771    qed
772  }
773qed
774
775instance prod :: (AOT_Term_id, AOT_Term_id) AOT_Term_id
776proof
777  AOT_modally_strict {
778    fix τ τ' :: 'a×'b
779    AOT_show τ = τ'  τ
780    proof (induct τ; induct τ'; rule "→I")
781      fix τ1 τ1' :: 'a and τ2  τ2' :: 'b
782      AOT_assume «(τ1, τ2)» = «(τ1', τ2')»
783      AOT_hence (τ1 = τ1') & (τ2 = τ2') by (metis "≡dfE" tuple_identity_1)
784      AOT_hence τ1 and τ2 using "t=t-proper:1" "&E" "vdash-properties:10" by blast+
785      AOT_thus «(τ1, τ2)» by (metis "≡dfI" "&I" tuple_denotes)
786    qed
787  }
788next
789  AOT_modally_strict {
790    fix τ τ' :: 'a×'b
791    AOT_show τ = τ'  τ'
792    proof (induct τ; induct τ'; rule "→I")
793      fix τ1 τ1' :: 'a and τ2  τ2' :: 'b
794      AOT_assume «(τ1, τ2)» = «(τ1', τ2')»
795      AOT_hence (τ1 = τ1') & (τ2 = τ2') by (metis "≡dfE" tuple_identity_1)
796      AOT_hence τ1' and τ2' using "t=t-proper:2" "&E" "vdash-properties:10" by blast+
797      AOT_thus «(τ1', τ2')» by (metis "≡dfI" "&I" tuple_denotes)
798    qed
799  }
800qed
801
802(* TODO: this is the end of the "proof by types" and makes the results available on new theorems *)
803AOT_register_type_constraints
804  Term: _::AOT_Term_id› _::AOT_Term_id›
805AOT_register_type_constraints
806  Individual: ‹κ› _::{AOT_κs, AOT_Term_id}
807AOT_register_type_constraints
808  Relation: <_::{AOT_κs, AOT_Term_id}>
809
810AOT_theorem "id-rel-nec-equiv:1": Π = Π'  x1...∀xn ([Π]x1...xn  [Π']x1...xn)
811proof(rule "→I")
812  AOT_assume assumption: Π = Π'
813  AOT_hence Π and Π'
814    using "t=t-proper:1" "t=t-proper:2" MP by blast+
815  moreover AOT_have FG (F = G  ((x1...∀xn ([F]x1...xn  [F]x1...xn))  x1...∀xn ([F]x1...xn  [G]x1...xn)))
816    apply (rule GEN)+ using "l-identity"[axiom_inst] by force
817  ultimately AOT_have Π = Π'  ((x1...∀xn ([Π]x1...xn  [Π]x1...xn))  x1...∀xn ([Π]x1...xn  [Π']x1...xn))
818    using "∀E"(1) by blast
819  AOT_hence (x1...∀xn ([Π]x1...xn  [Π]x1...xn))  x1...∀xn ([Π]x1...xn  [Π']x1...xn)
820    using assumption "→E" by blast
821  moreover AOT_have x1...∀xn ([Π]x1...xn  [Π]x1...xn)
822    by (simp add: RN "oth-class-taut:3:a" "universal-cor")
823  ultimately AOT_show x1...∀xn ([Π]x1...xn  [Π']x1...xn)
824    using "→E" by blast
825qed
826
827AOT_theorem "id-rel-nec-equiv:2": φ = ψ  (φ  ψ)
828proof(rule "→I")
829  AOT_assume assumption: φ = ψ
830  AOT_hence φ and ψ
831    using "t=t-proper:1" "t=t-proper:2" MP by blast+
832  moreover AOT_have pq (p = q  (((p  p)  (p  q))))
833    apply (rule GEN)+ using "l-identity"[axiom_inst] by force
834  ultimately AOT_have φ = ψ  ((φ  φ)  (φ  ψ))
835    using "∀E"(1) by blast
836  AOT_hence (φ  φ)  (φ  ψ)
837    using assumption "→E" by blast
838  moreover AOT_have (φ  φ)
839    by (simp add: RN "oth-class-taut:3:a" "universal-cor")
840  ultimately AOT_show (φ  ψ)
841    using "→E" by blast
842qed
843
844AOT_theorem "rule=E": assumes φ{τ} and τ = σ shows φ{σ}
845proof -
846  AOT_have τ and σ using assms(2) "t=t-proper:1" "t=t-proper:2" "→E" by blast+
847  moreover AOT_have αβ(α = β  (φ{α}  φ{β}))
848    apply (rule GEN)+ using "l-identity"[axiom_inst] by blast
849  ultimately AOT_have τ = σ  (φ{τ}  φ{σ})
850    using "∀E"(1) by blast
851  AOT_thus φ{σ} using assms "→E" by blast
852qed
853
854AOT_theorem "propositions-lemma:1":  φ] = φ
855proof -
856  AOT_have φ by (simp add: "log-prop-prop:2")
857  moreover AOT_have p  p] = p using "lambda-predicates:3[zero]"[axiom_inst] "∀I" by fast
858  ultimately AOT_show  φ] = φ
859    using "∀E" by blast
860qed
861
862AOT_theorem "propositions-lemma:2":  φ]  φ
863proof -
864  AOT_have  φ]   φ] by (simp add: "oth-class-taut:3:a")
865  AOT_thus  φ]  φ using "propositions-lemma:1" "rule=E" by blast
866qed
867
868(* propositions-lemma:3 through propositions-lemma:5 do not apply *)
869
870AOT_theorem "propositions-lemma:6": (φ  ψ)  ( φ]   ψ])
871  by (metis "≡E"(1) "≡E"(5) "Associativity of ≡" "propositions-lemma:2")
872
873(* dr-alphabetic-rules does not apply *)
874
875AOT_theorem "oa-exist:1": O!
876proof -
877  AOT_have x [E!]x] by "cqt:2[lambda]"
878  AOT_hence 1: O! = x [E!]x] using "df-rules-terms[4]"[OF "oa:1", THEN "&E"(1)] "→E" by blast
879  AOT_show O! using "t=t-proper:1"[THEN "→E", OF 1] by simp
880qed
881
882AOT_theorem "oa-exist:2": A!
883proof -
884  AOT_have x ¬[E!]x] by "cqt:2[lambda]"
885  AOT_hence 1: A! = x ¬[E!]x] using "df-rules-terms[4]"[OF "oa:2", THEN "&E"(1)] "→E" by blast
886  AOT_show A! using "t=t-proper:1"[THEN "→E", OF 1] by simp
887qed
888
889AOT_theorem "oa-exist:3": O!x  A!x
890proof(rule "raa-cor:1")
891  AOT_assume ¬(O!x  A!x)
892  AOT_hence A: ¬O!x and B: ¬A!x
893    using "Disjunction Addition"(1) "modus-tollens:1" "∨I"(2) "raa-cor:5" by blast+
894  AOT_have C: O! = x [E!]x]
895    by (rule "df-rules-terms[4]"[OF "oa:1", THEN "&E"(1), THEN "→E"]) "cqt:2[lambda]"
896  AOT_have D: A! = x ¬[E!]x]
897    by (rule "df-rules-terms[4]"[OF "oa:2", THEN "&E"(1), THEN "→E"]) "cqt:2[lambda]"
898  AOT_have E: ¬x [E!]x]x
899    using A C "rule=E" by fast
900  AOT_have F: ¬x ¬[E!]x]x
901    using B D "rule=E" by fast
902  AOT_have G: x [E!]x]x  [E!]x
903    by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
904  AOT_have H: x ¬[E!]x]x  ¬[E!]x
905    by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
906  AOT_show ¬[E!]x & ¬¬[E!]x using G E "≡E" H F "≡E" "&I" by metis
907qed
908
909AOT_theorem "p-identity-thm2:1": F = G  x(x[F]  x[G])
910proof -
911  AOT_have F = G  F & G & x(x[F]  x[G])
912    using "identity:2" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
913  moreover AOT_have F and G
914    by (auto simp: "cqt:2[const_var]"[axiom_inst])
915  ultimately AOT_show F = G  x(x[F]  x[G])
916    using "≡S"(1) "&I" by blast
917qed
918
919AOT_theorem "p-identity-thm2:2[2]": F = G  y1(x [F]xy1] = x [G]xy1] & x [F]y1x] = x [G]y1x])
920proof -
921  AOT_have F = G  F & G & y1(x [F]xy1] = x [G]xy1] & x [F]y1x] = x [G]y1x])
922    using "identity:3[2]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
923  moreover AOT_have F and G
924    by (auto simp: "cqt:2[const_var]"[axiom_inst])
925  ultimately show ?thesis
926    using "≡S"(1) "&I" by blast
927qed
928    
929AOT_theorem "p-identity-thm2:2[3]": F = G  y1y2(x [F]xy1y2] = x [G]xy1y2] & x [F]y1xy2] = x [G]y1xy2] & x [F]y1y2x] = x [G]y1y2x])
930proof -
931  AOT_have F = G  F & G & y1y2(x [F]xy1y2] = x [G]xy1y2] & x [F]y1xy2] = x [G]y1xy2] & x [F]y1y2x] = x [G]y1y2x])
932    using "identity:3[3]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
933  moreover AOT_have F and G
934    by (auto simp: "cqt:2[const_var]"[axiom_inst])
935  ultimately show ?thesis
936    using "≡S"(1) "&I" by blast
937qed
938
939AOT_theorem "p-identity-thm2:2[4]": F = G  y1y2y3(x [F]xy1y2y3] = x [G]xy1y2y3] & x [F]y1xy2y3] = x [G]y1xy2y3] & x [F]y1y2xy3] = x [G]y1y2xy3] & x [F]y1y2y3x] = x [G]y1y2y3x])
940proof -
941  AOT_have F = G  F & G & y1y2y3(x [F]xy1y2y3] = x [G]xy1y2y3] & x [F]y1xy2y3] = x [G]y1xy2y3] & x [F]y1y2xy3] = x [G]y1y2xy3] & x [F]y1y2y3x] = x [G]y1y2y3x])
942    using "identity:3[4]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
943  moreover AOT_have F and G
944    by (auto simp: "cqt:2[const_var]"[axiom_inst])
945  ultimately show ?thesis
946    using "≡S"(1) "&I" by blast
947qed
948
949AOT_theorem "p-identity-thm2:2":
950  F = G  x1...∀xn «AOT_sem_proj_id x1xn (λ τ . «[F]τ») (λ τ . «[G]τ»)»
951proof -
952  AOT_have F = G  F & G & x1...∀xn «AOT_sem_proj_id x1xn (λ τ . «[F]τ») (λ τ . «[G]τ»)»
953    using "identity:3" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
954  moreover AOT_have F and G
955    by (auto simp: "cqt:2[const_var]"[axiom_inst])
956  ultimately show ?thesis
957    using "≡S"(1) "&I" by blast
958qed
959
960AOT_theorem "p-identity-thm2:3":
961  p = q  x p] = x q]
962proof -
963  AOT_have p = q  p & q & x p] = x q]
964    using "identity:4" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
965  moreover AOT_have p and q
966    by (auto simp: "cqt:2[const_var]"[axiom_inst])
967  ultimately show ?thesis
968    using "≡S"(1) "&I" by blast
969qed
970
971class AOT_Term_id_2 = AOT_Term_id + assumes "id-eq:1": [v  α = α]
972
973instance κ :: AOT_Term_id_2
974proof
975  AOT_modally_strict {
976    fix x
977    {
978      AOT_assume O!x
979      moreover AOT_have F([F]x  [F]x)
980        using RN GEN "oth-class-taut:3:a" by fast
981      ultimately AOT_have O!x & O!x & F([F]x  [F]x) using "&I" by simp
982    }
983    moreover {
984      AOT_assume A!x
985      moreover AOT_have F(x[F]  x[F])
986        using RN GEN "oth-class-taut:3:a" by fast
987      ultimately AOT_have A!x & A!x & F(x[F]  x[F]) using "&I" by simp
988    }
989    ultimately AOT_have (O!x & O!x & F([F]x  [F]x))  (A!x & A!x & F(x[F]  x[F]))
990      using "oa-exist:3" "∨I"(1) "∨I"(2) "∨E"(3) "raa-cor:1" by blast
991    AOT_thus x = x
992      using "identity:1"[THEN "df-rules-formulas[4]"] "→E" by blast
993  }
994qed
995
996instance rel :: ("{AOT_κs,AOT_Term_id_2}") AOT_Term_id_2
997proof
998  AOT_modally_strict {
999    fix F :: "<'a> AOT_var"
1000    AOT_have 0: x1...xn [F]x1...xn] = F
1001      by (simp add: "lambda-predicates:3"[axiom_inst])
1002    AOT_have x1...xn [F]x1...xn]
1003      by "cqt:2[lambda]"
1004    AOT_hence x1...xn [F]x1...xn] = x1...xn [F]x1...xn]
1005      using "lambda-predicates:1"[axiom_inst] "→E" by blast
1006    AOT_show F = F using "rule=E" 0 by force 
1007  }
1008qed
1009
1010instance 𝗈 :: AOT_Term_id_2
1011proof
1012  AOT_modally_strict {
1013    fix p
1014    AOT_have 0:  p] = p
1015      by (simp add: "lambda-predicates:3[zero]"[axiom_inst])
1016    AOT_have  p]
1017      by (rule "cqt:2[lambda0]"[axiom_inst])
1018    AOT_hence  p] =  p]
1019      using "lambda-predicates:1[zero]"[axiom_inst] "→E" by blast
1020    AOT_show p = p using "rule=E" 0 by force
1021  }
1022qed
1023
1024instance prod :: (AOT_Term_id_2, AOT_Term_id_2) AOT_Term_id_2
1025proof
1026  AOT_modally_strict {
1027    fix α :: ('a×'b) AOT_var›
1028    AOT_show α = α
1029    proof (induct)
1030      AOT_show τ = τ if τ for τ :: 'a×'b
1031        using that
1032      proof (induct τ)
1033        fix τ1 :: 'a and τ2 :: 'b
1034        AOT_assume «(τ1,τ2)»
1035        AOT_hence τ1 and τ2 using "≡dfE" "&E" tuple_denotes by blast+
1036        AOT_hence τ1 = τ1 and τ2 = τ2 using "id-eq:1"[unvarify α] by blast+
1037        AOT_thus «(τ1, τ2)» = «(τ1, τ2)» by (metis "≡dfI" "&I" tuple_identity_1)
1038      qed
1039    qed
1040  }
1041qed
1042
1043AOT_register_type_constraints
1044  Term: _::AOT_Term_id_2› _::AOT_Term_id_2›
1045AOT_register_type_constraints
1046  Individual: ‹κ› _::{AOT_κs, AOT_Term_id_2}
1047AOT_register_type_constraints
1048  Relation: <_::{AOT_κs, AOT_Term_id_2}>
1049
1050(* TODO: Interestingly, this doesn't depend on "id-eq:1" at all! *)
1051AOT_theorem "id-eq:2": α = β  β = α
1052(*
1053  TODO: look at this proof generated using:
1054        including AOT_no_atp sledgehammer[isar_proofs = true]
1055proof -
1056  have "(∃φ. [v ⊨ ~β = α → ~φ] ∧ [v ⊨ α = β → φ]) ∨ (∃φ. ¬ [v ⊨ φ{α} → φ{β}])"
1057    by meson
1058  then show ?thesis
1059    by (meson "contraposition:2" "Hypothetical Syllogism" "deduction-theorem" l_"identity:1" "useful-tautologies:1")
1060qed
1061*)
1062(*  by (meson "rule=E" "deduction-theorem") *)
1063proof (rule "→I")
1064  AOT_assume α = β
1065  moreover AOT_have β = β using calculation "rule=E"[of _ "λ τ . «τ = β»" "AOT_term_of_var α" "AOT_term_of_var β"] by blast
1066  moreover AOT_have α = α  α = α using "if-p-then-p" by blast
1067  ultimately AOT_show β = α
1068    using "→E" "→I" "rule=E"[of _ "λ τ . «(τ = τ)  (τ = α)»" "AOT_term_of_var α" "AOT_term_of_var β"] by blast
1069qed
1070
1071AOT_theorem "id-eq:3": α = β & β = γ  α = γ
1072  using "rule=E" "→I" "&E" by blast
1073
1074AOT_theorem "id-eq:4": α = β  γ (α = γ  β = γ)
1075proof (rule "≡I"; rule "→I")
1076  AOT_assume 0: α = β
1077  AOT_hence 1: β = α using "id-eq:2" "→E" by blast
1078  AOT_show γ (α = γ  β = γ)
1079    by (rule GEN) (metis "≡I" "→I" 0 "1" "rule=E")
1080next
1081  AOT_assume γ (α = γ  β = γ)
1082  AOT_hence α = α  β = α using "∀E"(2) by blast
1083  AOT_hence α = α  β = α using "≡E"(1) "→I" by blast
1084  AOT_hence β = α using "id-eq:1" "→E" by blast
1085  AOT_thus α = β using "id-eq:2" "→E" by blast
1086qed
1087
1088AOT_theorem "rule=I:1": assumes τ shows τ = τ
1089proof -
1090  AOT_have α (α = α)
1091    by (rule GEN) (metis "id-eq:1")
1092  AOT_thus τ = τ using assms "∀E" by blast
1093qed
1094
1095AOT_theorem "rule=I:2[const_var]": "α = α"
1096  using "id-eq:1".
1097
1098AOT_theorem "rule=I:2[lambda]": assumes INSTANCE_OF_CQT_2(φ) shows "ν1...νn φ{ν1...νn}] = ν1...νn φ{ν1...νn}]"
1099proof -
1100  AOT_have α (α = α)
1101    by (rule GEN) (metis "id-eq:1")
1102  moreover AOT_have ν1...νn φ{ν1...νn}] using assms by (rule "cqt:2[lambda]"[axiom_inst])
1103  ultimately AOT_show ν1...νn φ{ν1...νn}] = ν1...νn φ{ν1...νn}] using assms "∀E" by blast
1104qed
1105
1106lemmas "=I" = "rule=I:1" "rule=I:2[const_var]" "rule=I:2[lambda]"
1107
1108AOT_theorem "rule-id-def:1":
1109  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn}
1110  shows τ{τ1...τn} = σ{τ1...τn}
1111proof -
1112  AOT_have σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}
1113    using "df-rules-terms[3]" assms(1) "&E" by blast
1114  AOT_thus τ{τ1...τn} = σ{τ1...τn}
1115    using assms(2) "→E" by blast
1116qed
1117
1118AOT_theorem "rule-id-def:1[zero]":
1119  assumes τ =df σ and σ
1120  shows τ = σ
1121proof -
1122  AOT_have σ  τ = σ
1123    using "df-rules-terms[4]" assms(1) "&E" by blast
1124  AOT_thus τ = σ
1125    using assms(2) "→E" by blast
1126qed
1127
1128AOT_theorem "rule-id-def:2:a":
1129  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn} and φ{τ{τ1...τn}}
1130  shows φ{σ{τ1...τn}}
1131proof -
1132  AOT_have τ{τ1...τn} = σ{τ1...τn} using "rule-id-def:1" assms(1,2) by blast
1133  AOT_thus φ{σ{τ1...τn}} using assms(3) "rule=E" by blast
1134qed
1135
1136(* TODO: get rid of this, ideally *)
1137AOT_theorem "rule-id-def:2:a[2]":
1138  assumes τ{«(α1,α2)»} =df σ{«(α1,α2)»} and σ{«(τ1,τ2)»} and φ{τ{«(τ1,τ2)»}}
1139  shows φ{σ{«(τ1,τ2)»}}
1140proof -
1141  AOT_have τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1142  proof -
1143    AOT_have σ{«(τ1,τ2)»}  τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1144      using assms by (simp add: AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
1145    AOT_thus τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1146      using assms(2) "→E" by blast
1147  qed
1148  AOT_thus φ{σ{«(τ1,τ2)»}} using assms(3) "rule=E" by blast
1149qed
1150
1151AOT_theorem "rule-id-def:2:a[zero]":
1152  assumes τ =df σ and σ and φ{τ}
1153  shows φ{σ}
1154proof -
1155  AOT_have τ = σ using "rule-id-def:1[zero]" assms(1,2) by blast
1156  AOT_thus φ{σ} using assms(3) "rule=E" by blast
1157qed
1158
1159lemmas "=dfE" = "rule-id-def:2:a" "rule-id-def:2:a[zero]"
1160
1161AOT_theorem "rule-id-def:2:b":
1162  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn} and φ{σ{τ1...τn}}
1163  shows φ{τ{τ1...τn}}
1164proof -
1165  AOT_have τ{τ1...τn} = σ{τ1...τn} using "rule-id-def:1" assms(1,2) by blast
1166  AOT_hence σ{τ1...τn} = τ{τ1...τn}
1167    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1168  AOT_thus φ{τ{τ1...τn}} using assms(3) "rule=E" by blast
1169qed
1170
1171(* TODO: get rid of this, ideally *)
1172AOT_theorem "rule-id-def:2:b[2]":
1173  assumes τ{«(α1,α2)»} =df σ{«(α1,α2)»} and σ{«(τ1,τ2)»} and φ{σ{«(τ1,τ2)»}}
1174  shows φ{τ{«(τ1,τ2)»}}
1175proof -
1176  AOT_have τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1177  proof -
1178    AOT_have σ{«(τ1,τ2)»}  τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1179      using assms by (simp add: AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
1180    AOT_thus τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1181      using assms(2) "→E" by blast
1182  qed
1183  AOT_hence σ{«(τ1,τ2)»} = τ{«(τ1,τ2)»}
1184    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1185  AOT_thus φ{τ{«(τ1,τ2)»}} using assms(3) "rule=E" by blast
1186qed
1187
1188AOT_theorem "rule-id-def:2:b[zero]":
1189  assumes τ =df σ and σ and φ{σ}
1190  shows φ{τ}
1191proof -
1192  AOT_have τ = σ using "rule-id-def:1[zero]" assms(1,2) by blast
1193  AOT_hence σ = τ
1194    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1195  AOT_thus φ{τ} using assms(3) "rule=E" by blast
1196qed
1197
1198lemmas "=dfI" = "rule-id-def:2:b" "rule-id-def:2:b[zero]"
1199
1200AOT_theorem "free-thms:1": τ  β (β = τ)
1201  by (metis "∃E" "rule=I:1" "t=t-proper:2" "→I" "∃I"(1) "≡I" "→E")
1202
1203AOT_theorem "free-thms:2": α φ{α}  (β (β = τ)  φ{τ})
1204  by (metis "∃E" "rule=E" "cqt:2[const_var]"[axiom_inst] "→I" "∀E"(1))
1205
1206AOT_theorem "free-thms:3[const_var]": β (β = α)
1207  by (meson "∃I"(2) "id-eq:1")
1208
1209AOT_theorem "free-thms:3[lambda]": assumes INSTANCE_OF_CQT_2(φ) shows β (β = ν1...νn φ{ν1...νn}])
1210  by (meson "=I"(3) assms "cqt:2[lambda]"[axiom_inst] "existential:1")
1211
1212AOT_theorem "free-thms:4[rel]": ([Π]κ1...κn  κ1...κn[Π])  β (β = Π)
1213  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1214
1215(* TODO: this is a rather weird way to formulate this and we don't have tuple-existential-elimination
1216         or tuple-equality-elimination in the theory... Splitting them is also a bit unfortunate, though.*)
1217AOT_theorem "free-thms:4[vars]": ([Π]κ1...κn  κ1...κn[Π])  β1...∃βn (β1...βn = κ1...κn)
1218  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1219
1220AOT_theorem "free-thms:4[1,rel]": ([Π]κ  κ[Π])  β (β = Π)
1221  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1222AOT_theorem "free-thms:4[1,1]": ([Π]κ  κ[Π])  β (β = κ)
1223  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1224
1225AOT_theorem "free-thms:4[2,rel]": ([Π]κ1κ2  κ1κ2[Π])  β (β = Π)
1226  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1227AOT_theorem "free-thms:4[2,1]": ([Π]κ1κ2  κ1κ2[Π])  β (β = κ1)
1228  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1229AOT_theorem "free-thms:4[2,2]": ([Π]κ1κ2  κ1κ2[Π])  β (β = κ2)
1230  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1231AOT_theorem "free-thms:4[3,rel]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = Π)
1232  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1233AOT_theorem "free-thms:4[3,1]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ1)
1234  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1235AOT_theorem "free-thms:4[3,2]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ2)
1236  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1237AOT_theorem "free-thms:4[3,3]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ3)
1238  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1239AOT_theorem "free-thms:4[4,rel]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = Π)
1240  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1241AOT_theorem "free-thms:4[4,1]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ1)
1242  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1243AOT_theorem "free-thms:4[4,2]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ2)
1244  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1245AOT_theorem "free-thms:4[4,3]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ3)
1246  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1247AOT_theorem "free-thms:4[4,4]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ4)
1248  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1249
1250AOT_theorem "ex:1:a": α α
1251  by (rule GEN) (fact "cqt:2[const_var]"[axiom_inst])
1252AOT_theorem "ex:1:b": αβ(β = α)
1253  by (rule GEN) (fact "free-thms:3[const_var]")
1254
1255AOT_theorem "ex:2:a": α
1256  by (rule RN) (fact "cqt:2[const_var]"[axiom_inst])
1257AOT_theorem "ex:2:b": β(β = α)
1258  by (rule RN) (fact "free-thms:3[const_var]")
1259
1260AOT_theorem "ex:3:a": α α
1261  by (rule RN) (fact "ex:1:a")
1262AOT_theorem "ex:3:b": αβ(β = α)
1263  by (rule RN) (fact "ex:1:b")
1264
1265AOT_theorem "ex:4:a": α α
1266  by (rule GEN; rule RN) (fact "cqt:2[const_var]"[axiom_inst])
1267AOT_theorem "ex:4:b": αβ(β = α)
1268  by (rule GEN; rule RN) (fact "free-thms:3[const_var]")
1269
1270AOT_theorem "ex:5:a": α α
1271  by (rule RN) (simp add: "ex:4:a")
1272AOT_theorem "ex:5:b": αβ(β = α)
1273  by (rule RN) (simp add: "ex:4:b")
1274
1275AOT_theorem "all-self=:1": α(α = α)
1276  by (rule RN; rule GEN) (fact "id-eq:1")
1277AOT_theorem "all-self=:2": α(α = α)
1278  by (rule GEN; rule RN) (fact "id-eq:1")
1279
1280AOT_theorem "id-nec:1": α = β  (α = β)
1281proof(rule "→I")
1282  AOT_assume α = β
1283  moreover AOT_have (α = α)
1284    by (rule RN) (fact "id-eq:1")
1285  ultimately AOT_show (α = β) using "rule=E" by fast
1286qed
1287
1288AOT_theorem "id-nec:2": τ = σ  (τ = σ)
1289proof(rule "→I")
1290  AOT_assume asm: τ = σ
1291  moreover AOT_have τ
1292    using calculation "t=t-proper:1" "→E" by blast
1293  moreover AOT_have (τ = τ)
1294    using calculation "all-self=:2" "∀E"(1) by blast
1295  ultimately AOT_show (τ = σ) using "rule=E" by fast
1296qed
1297
1298AOT_theorem "term-out:1": φ{α}  β (β = α & φ{β})
1299proof (rule "≡I"; rule "→I")
1300  AOT_assume asm: φ{α}
1301  AOT_show β (β = α & φ{β})
1302    by (rule "∃I"(2)[where β=α]; rule "&I")
1303       (auto simp: "id-eq:1" asm)
1304next
1305  AOT_assume 0: β (β = α & φ{β})
1306  (* TODO: have another look at this instantiation. Ideally AOT_obtain would resolve directly to the existential
1307           statement as proof obligation *)
1308  AOT_obtain β where β = α & φ{β} using "instantiation"[rotated, OF 0] by blast
1309  AOT_thus φ{α} using "&E" "rule=E" by blast
1310qed
1311
1312AOT_theorem "term-out:2": τ  (φ{τ}  α(α = τ & φ{α}))
1313proof(rule "→I")
1314  AOT_assume τ
1315  moreover AOT_have α (φ{α}  β (β = α & φ{β}))
1316    by (rule GEN) (fact "term-out:1")
1317  ultimately AOT_show φ{τ}  α(α = τ & φ{α})
1318    using "∀E" by blast
1319qed
1320
1321(* TODO: example of an apply-style proof. Keep or reformulate? *)
1322AOT_theorem "term-out:3": (φ{α} & β(φ{β}  β = α))  β(φ{β}  β = α)
1323  apply (rule "≡I"; rule "→I")
1324   apply (frule "&E"(1)) apply (drule "&E"(2))
1325   apply (rule GEN; rule "≡I"; rule "→I")
1326  using "rule-ui:2[const_var]" "vdash-properties:5" apply blast
1327  apply (meson "rule=E" "id-eq:1")
1328  apply (rule "&I")
1329  using "id-eq:1" "≡E"(2) "rule-ui:3" apply blast
1330  apply (rule GEN; rule "→I")
1331  using "≡E"(1) "rule-ui:2[const_var]" by blast
1332
1333AOT_theorem "term-out:4": (φ{β} & α(φ{α}  α = β))  α(φ{α}  α = β)
1334  using "term-out:3" . (* TODO: same as above - another instance of the generalized alphabetic variant rule... *)
1335
1336(* TODO: would of course be nice to define it without the syntax magic *)
1337AOT_define AOT_exists_unique :: ‹α  φ  φ›
1338  "uniqueness:1": «AOT_exists_unique φ» df α (φ{α} & β (φ{β}  β = α))
1339syntax "_AOT_exists_unique" :: ‹α  φ  φ› ("∃!_ _" [1,40])
1340AOT_syntax_print_translations
1341  "_AOT_exists_unique τ φ" <= "CONST AOT_exists_unique (_abs τ φ)"
1342syntax
1343   "_AOT_exists_unique_ellipse" :: ‹id_position  id_position  φ  φ› (∃!_...∃!_ _› [1,40])
1344parse_ast_translation[(syntax_const‹_AOT_exists_unique_ellipse›, fn ctx => fn [a,b,c] =>
1345  Ast.mk_appl (Ast.Constant "AOT_exists_unique") [parseEllipseList "_AOT_vars" ctx [a,b],c]),
1346(syntax_const‹_AOT_exists_unique›,AOT_restricted_binder const_name‹AOT_exists_unique› const_syntax‹AOT_conj›)]
1347print_translationAOT_syntax_print_translations
1348  [AOT_preserve_binder_abs_tr' const_syntax‹AOT_exists_unique› syntax_const‹_AOT_exists_unique› (syntax_const‹_AOT_exists_unique_ellipse›, true) const_name‹AOT_conj›,
1349  AOT_binder_trans @{theory} @{binding "AOT_exists_unique_binder"} syntax_const‹_AOT_exists_unique›]
1350
1351
1352
1353context AOT_meta_syntax
1354begin
1355notation AOT_exists_unique (binder "!" 20)
1356end
1357context AOT_no_meta_syntax
1358begin
1359no_notation AOT_exists_unique (binder "!" 20)
1360end
1361
1362AOT_theorem "uniqueness:2": ∃!α φ{α}  αβ(φ{β}  β = α)
1363proof(rule "≡I"; rule "→I")
1364    AOT_assume ∃!α φ{α}
1365    AOT_hence α (φ{α} & β (φ{β}  β = α))
1366      using "uniqueness:1" "≡dfE" by blast
1367    then AOT_obtain α where φ{α} & β (φ{β}  β = α) using "instantiation"[rotated] by blast
1368    AOT_hence β(φ{β}  β = α) using "term-out:3" "≡E" by blast
1369    AOT_thus αβ(φ{β}  β = α)
1370      using "∃I" by fast
1371next
1372    AOT_assume αβ(φ{β}  β = α)
1373    then AOT_obtain α where β (φ{β}  β = α) using "instantiation"[rotated] by blast
1374    AOT_hence φ{α} & β (φ{β}  β = α) using "term-out:3" "≡E" by blast
1375    AOT_hence α (φ{α} & β (φ{β}  β = α))
1376      using "∃I" by fast
1377    AOT_thus ∃!α φ{α}
1378      using "uniqueness:1" "≡dfI" by blast
1379qed
1380
1381AOT_theorem "uni-most": ∃!α φ{α}  βγ((φ{β} & φ{γ})  β = γ)
1382proof(rule "→I"; rule GEN; rule GEN; rule "→I")
1383  fix β γ
1384  AOT_assume ∃!α φ{α}
1385  AOT_hence αβ(φ{β}  β = α)
1386    using "uniqueness:2" "≡E" by blast
1387  then AOT_obtain α where β(φ{β}  β = α)
1388    using "instantiation"[rotated] by blast
1389  moreover AOT_assume φ{β} & φ{γ}
1390  ultimately AOT_have β = α and γ = α
1391    using "∀E"(2) "&E" "≡E"(1,2) by blast+
1392  AOT_thus β = γ
1393    by (metis "rule=E" "id-eq:2" "→E")
1394qed
1395
1396AOT_theorem "nec-exist-!": α(φ{α}  φ{α})  (∃!α φ{α}  ∃!α φ{α})
1397proof (rule "→I"; rule "→I")
1398  AOT_assume a: α(φ{α}  φ{α})
1399  AOT_assume ∃!α φ{α}
1400  AOT_hence α (φ{α} & β (φ{β}  β = α)) using "uniqueness:1" "≡dfE" by blast
1401  then AOT_obtain α where ξ: φ{α} & β (φ{β}  β = α) using "instantiation"[rotated] by blast
1402  AOT_have φ{α}
1403    using ξ a "&E" "∀E" "→E" by fast
1404  moreover AOT_have β (φ{β}  β = α)
1405    apply (rule GEN; rule "→I")
1406    using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "→E"] "qml:2"[axiom_inst, THEN "→E"] by blast
1407  ultimately AOT_have (φ{α} & β (φ{β}  β = α))
1408    using "&I" by blast
1409  AOT_thus ∃!α φ{α}
1410    using "uniqueness:1" "≡dfI" "∃I" by fast
1411qed
1412
1413AOT_theorem "act-cond": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1414  using "→I" "≡E"(1) "logic-actual-nec:2"[axiom_inst] by blast
1415
1416AOT_theorem "nec-imp-act": φ  𝒜φ
1417  by (metis "act-cond" "contraposition:1[2]" "≡E"(4) "qml:2"[THEN act_closure, axiom_inst] "qml-act:2"[axiom_inst] RAA(1) "→E" "→I")
1418
1419AOT_theorem "act-conj-act:1": 𝒜(𝒜φ  φ)
1420  using "→I" "≡E"(2) "logic-actual-nec:2"[axiom_inst] "logic-actual-nec:4"[axiom_inst] by blast
1421
1422AOT_theorem "act-conj-act:2": 𝒜(φ  𝒜φ)
1423  by (metis "→I" "≡E"(2, 4) "logic-actual-nec:2"[axiom_inst] "logic-actual-nec:4"[axiom_inst] RAA(1))
1424
1425AOT_theorem "act-conj-act:3": (𝒜φ & 𝒜ψ)  𝒜(φ & ψ)
1426proof -
1427  AOT_have (φ  (ψ  (φ & ψ)))
1428    by (rule RN) (fact Adjunction)
1429  AOT_hence 𝒜(φ  (ψ  (φ & ψ)))
1430    using "nec-imp-act" "→E" by blast
1431  AOT_hence 𝒜φ  𝒜(ψ  (φ & ψ))
1432    using "act-cond" "→E" by blast
1433  moreover AOT_have 𝒜(ψ  (φ & ψ))  (𝒜ψ  𝒜(φ & ψ))
1434    by (fact "act-cond")
1435  ultimately AOT_have 𝒜φ  (𝒜ψ  𝒜(φ & ψ))
1436    using "→I" "→E" by metis
1437  AOT_thus (𝒜φ & 𝒜ψ)  𝒜(φ & ψ)
1438    by (metis Importation "→E")
1439qed
1440
1441AOT_theorem "act-conj-act:4": 𝒜(𝒜φ  φ)
1442proof -
1443  AOT_have (𝒜(𝒜φ  φ) & 𝒜(φ  𝒜φ))  𝒜((𝒜φ  φ) & (φ  𝒜φ))
1444    by (fact "act-conj-act:3")
1445  moreover AOT_have 𝒜(𝒜φ  φ) & 𝒜(φ  𝒜φ)
1446    using "&I" "act-conj-act:1" "act-conj-act:2" by simp
1447  ultimately AOT_have ζ: 𝒜((𝒜φ  φ) & (φ  𝒜φ))
1448    using "→E" by blast
1449  AOT_have 𝒜(((𝒜φ  φ) & (φ  𝒜φ))  (𝒜φ  φ))
1450    using "conventions:3"[THEN "df-rules-formulas[2]", THEN act_closure, axiom_inst] by blast
1451  AOT_hence 𝒜((𝒜φ  φ) & (φ  𝒜φ))  𝒜(𝒜φ  φ)
1452    using "act-cond" "→E" by blast
1453  AOT_thus 𝒜(𝒜φ  φ) using ζ "→E" by blast
1454qed
1455
1456(* TODO: consider introducing AOT_inductive *)
1457inductive arbitrary_actualization for φ where
1458  arbitrary_actualization φ «𝒜φ»
1459| arbitrary_actualization φ «𝒜ψ» if arbitrary_actualization φ ψ
1460declare arbitrary_actualization.cases[AOT] arbitrary_actualization.induct[AOT]
1461        arbitrary_actualization.simps[AOT] arbitrary_actualization.intros[AOT]
1462syntax arbitrary_actualization :: ‹φ'  φ'  AOT_prop› ("ARBITRARY'_ACTUALIZATION'(_,_')")
1463
1464notepad
1465begin
1466  AOT_modally_strict {
1467    fix φ
1468    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜(𝒜φ  φ))
1469      using AOT_PLM.arbitrary_actualization.intros by metis
1470    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜𝒜(𝒜φ  φ))
1471      using AOT_PLM.arbitrary_actualization.intros by metis
1472    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜𝒜𝒜(𝒜φ  φ))
1473      using AOT_PLM.arbitrary_actualization.intros by metis
1474  }
1475end
1476
1477
1478AOT_theorem "closure-act:1": assumes ARBITRARY_ACTUALIZATION(𝒜φ  φ, ψ) shows ψ
1479using assms proof(induct)
1480  case 1
1481  AOT_show 𝒜(𝒜φ  φ)
1482    by (simp add: "act-conj-act:4")
1483next
1484  case (2 ψ)
1485  AOT_thus 𝒜ψ
1486    by (metis arbitrary_actualization.simps "≡E"(1) "logic-actual-nec:4"[axiom_inst])
1487qed
1488
1489AOT_theorem "closure-act:2": α 𝒜(𝒜φ{α}  φ{α})
1490  by (simp add: "act-conj-act:4" "∀I")
1491
1492AOT_theorem "closure-act:3": 𝒜α 𝒜(𝒜φ{α}  φ{α})
1493  by (metis (no_types, lifting) "act-conj-act:4" "≡E"(1,2) "logic-actual-nec:3"[axiom_inst] "logic-actual-nec:4"[axiom_inst] "∀I")
1494
1495AOT_theorem "closure-act:4": 𝒜α1...∀αn 𝒜(𝒜φ{α1...αn}  φ{α1...αn})
1496  using "closure-act:3" .
1497
1498(* TODO: examine these proofs *)
1499AOT_theorem "RA[1]": assumes  φ shows  𝒜φ
1500  (* This proof is the one rejected in remark (136) (meta-rule) *)
1501  using "¬¬E" assms "≡E"(3) "logic-actual"[act_axiom_inst] "logic-actual-nec:1"[axiom_inst] "modus-tollens:2" by blast
1502AOT_theorem "RA[2]": assumes  φ shows 𝒜φ
1503  (* This is actually Γ ⊢ φ ⟹ □Γ ⊢ 𝒜φ*)
1504  using RN assms "nec-imp-act" "vdash-properties:5" by blast
1505AOT_theorem "RA[3]": assumes Γ  φ shows 𝒜Γ  𝒜φ
1506  using assms by (meson AOT_sem_act imageI)
1507  (* This is not exactly right either. *)
1508
1509AOT_act_theorem "ANeg:1": ¬𝒜φ  ¬φ
1510  by (simp add: "RA[1]" "contraposition:1[1]" "deduction-theorem" "≡I" "logic-actual"[act_axiom_inst])
1511
1512AOT_act_theorem "ANeg:2": ¬𝒜¬φ  φ
1513  using "ANeg:1" "≡I" "≡E"(5) "useful-tautologies:1" "useful-tautologies:2" by blast
1514
1515AOT_theorem "Act-Basic:1": 𝒜φ  𝒜¬φ
1516  by (meson "∨I"(1,2) "≡E"(2) "logic-actual-nec:1"[axiom_inst] "raa-cor:1")
1517
1518AOT_theorem "Act-Basic:2": 𝒜(φ & ψ)  (𝒜φ & 𝒜ψ)
1519proof (rule "≡I"; rule "→I")
1520  AOT_assume 𝒜(φ & ψ)
1521  moreover AOT_have 𝒜((φ & ψ)  φ)
1522    by (simp add: "RA[2]" "Conjunction Simplification"(1))
1523  moreover AOT_have 𝒜((φ & ψ)  ψ)
1524    by (simp add: "RA[2]" "Conjunction Simplification"(2))
1525  ultimately AOT_show 𝒜φ & 𝒜ψ
1526    using "act-cond"[THEN "→E", THEN "→E"] "&I" by metis
1527next
1528  AOT_assume 𝒜φ & 𝒜ψ
1529  AOT_thus 𝒜(φ & ψ)
1530    using "act-conj-act:3" "vdash-properties:6" by blast
1531qed
1532
1533AOT_theorem "Act-Basic:3": 𝒜(φ  ψ)  (𝒜(φ  ψ) & 𝒜(ψ  φ))
1534proof (rule "≡I"; rule "→I")
1535  AOT_assume 𝒜(φ  ψ)
1536  moreover AOT_have 𝒜((φ  ψ)  (φ  ψ))
1537    by (simp add: "RA[2]" "deduction-theorem" "≡E"(1))
1538  moreover AOT_have 𝒜((φ  ψ)  (ψ  φ))
1539    by (simp add: "RA[2]" "deduction-theorem" "≡E"(2))
1540  ultimately AOT_show 𝒜(φ  ψ) & 𝒜(ψ  φ)
1541    using "act-cond"[THEN "→E", THEN "→E"] "&I" by metis
1542next
1543  AOT_assume 𝒜(φ  ψ) & 𝒜(ψ  φ)
1544  AOT_hence 𝒜((φ  ψ) & (ψ  φ))
1545    by (metis "act-conj-act:3" "vdash-properties:10")
1546  moreover AOT_have 𝒜(((φ  ψ) & (ψ  φ))  (φ  ψ))
1547    by (simp add: "conventions:3" "RA[2]" "df-rules-formulas[2]" "vdash-properties:1[2]")
1548  ultimately AOT_show 𝒜(φ  ψ)
1549    using "act-cond"[THEN "→E", THEN "→E"] by metis
1550qed
1551
1552AOT_theorem "Act-Basic:4": (𝒜(φ  ψ) & 𝒜(ψ  φ))  (𝒜φ  𝒜ψ)
1553proof (rule "≡I"; rule "→I")
1554  AOT_assume 0: 𝒜(φ  ψ) & 𝒜(ψ  φ)
1555  AOT_show 𝒜φ  𝒜ψ
1556    using 0 "&E" "act-cond"[THEN "→E", THEN "→E"] "≡I" "→I" by metis
1557next
1558  AOT_assume 𝒜φ  𝒜ψ
1559  AOT_thus 𝒜(φ  ψ) & 𝒜(ψ  φ)
1560    by (metis "→I" "logic-actual-nec:2"[axiom_inst] "≡E"(1,2) "&I")
1561qed
1562
1563AOT_theorem "Act-Basic:5": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1564  using "Act-Basic:3" "Act-Basic:4" "≡E"(5) by blast
1565
1566AOT_theorem "Act-Basic:6": 𝒜φ  𝒜φ
1567  by (simp add: "≡I" "qml:2"[axiom_inst] "qml-act:1"[axiom_inst])
1568
1569AOT_theorem "Act-Basic:7": 𝒜φ  𝒜φ
1570  by (metis "Act-Basic:6" "→I" "→E" "≡E"(1,2) "nec-imp-act" "qml-act:2"[axiom_inst])
1571
1572AOT_theorem "Act-Basic:8": φ  𝒜φ
1573  using "Hypothetical Syllogism" "nec-imp-act" "qml-act:1"[axiom_inst] by blast
1574
1575AOT_theorem "Act-Basic:9": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1576proof (rule "≡I"; rule "→I")
1577  AOT_assume 𝒜(φ  ψ)
1578  AOT_thus 𝒜φ  𝒜ψ
1579  proof (rule "raa-cor:3")
1580    AOT_assume ¬(𝒜φ  𝒜ψ)
1581    AOT_hence ¬𝒜φ & ¬𝒜ψ
1582      by (metis "≡E"(1) "oth-class-taut:5:d")
1583    AOT_hence 𝒜¬φ & 𝒜¬ψ
1584      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] "&E" "&I" by metis
1585    AOT_hence 𝒜(¬φ & ¬ψ)
1586      using "≡E" "Act-Basic:2" by metis
1587    moreover AOT_have 𝒜((¬φ & ¬ψ)  ¬(φ  ψ))
1588      using "RA[2]" "≡E"(6) "oth-class-taut:3:a" "oth-class-taut:5:d" by blast
1589    moreover AOT_have 𝒜(¬φ & ¬ψ)  𝒜(¬(φ  ψ))
1590      using calculation(2) by (metis "Act-Basic:5" "≡E"(1))
1591    ultimately AOT_have 𝒜(¬(φ  ψ)) using "≡E" by blast
1592    AOT_thus ¬𝒜(φ  ψ)
1593      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(1)] by auto
1594  qed
1595next
1596  AOT_assume 𝒜φ  𝒜ψ
1597  AOT_thus 𝒜(φ  ψ)
1598    by (meson "RA[2]" "act-cond" "∨I"(1) "∨E"(1) "Disjunction Addition"(1) "Disjunction Addition"(2))
1599qed
1600
1601AOT_theorem "Act-Basic:10": 𝒜α φ{α}  α 𝒜φ{α}
1602proof -
1603  AOT_have θ: ¬𝒜α ¬φ{α}  ¬α 𝒜¬φ{α}
1604    by (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
1605       (metis "logic-actual-nec:3"[axiom_inst])
1606  AOT_have ξ: ¬α 𝒜¬φ{α}  ¬α ¬𝒜φ{α}
1607    by (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
1608       (rule "logic-actual-nec:1"[THEN universal_closure, axiom_inst, THEN "cqt-basic:3"[THEN "→E"]])
1609  AOT_have 𝒜(α φ{α})  𝒜(¬α ¬φ{α})
1610    using "conventions:4"[THEN "df-rules-formulas[1]", THEN act_closure, axiom_inst]
1611          "conventions:4"[THEN "df-rules-formulas[2]", THEN act_closure, axiom_inst]
1612    "Act-Basic:4"[THEN "≡E"(1)] "&I" "Act-Basic:5"[THEN "≡E"(2)] by metis
1613  also AOT_have   ¬𝒜α ¬φ{α}
1614    by (simp add: "logic-actual-nec:1" "vdash-properties:1[2]")
1615  also AOT_have   ¬α 𝒜 ¬φ{α} using θ by blast
1616  also AOT_have   ¬α ¬𝒜 φ{α} using ξ by blast
1617  also AOT_have   α 𝒜 φ{α}
1618    using "conventions:4"[THEN "≡Df"] by (metis "≡E"(6) "oth-class-taut:3:a")
1619  finally AOT_show 𝒜α φ{α}  α 𝒜φ{α} .
1620qed
1621
1622
1623AOT_theorem "Act-Basic:11": 𝒜α(φ{α}  ψ{α})  α(𝒜φ{α}  𝒜ψ{α})
1624proof(rule "≡I"; rule "→I")
1625  AOT_assume 𝒜α(φ{α}  ψ{α})
1626  AOT_hence α𝒜(φ{α}  ψ{α})
1627    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(1)] by blast
1628  AOT_hence 𝒜(φ{α}  ψ{α}) for α using "∀E" by blast
1629  AOT_hence 𝒜φ{α}  𝒜ψ{α} for α by (metis "Act-Basic:5" "≡E"(1))
1630  AOT_thus α(𝒜φ{α}  𝒜ψ{α}) by (rule "∀I")
1631next
1632  AOT_assume α(𝒜φ{α}  𝒜ψ{α})
1633  AOT_hence 𝒜φ{α}  𝒜ψ{α} for α using "∀E" by blast
1634  AOT_hence 𝒜(φ{α}  ψ{α}) for α by (metis "Act-Basic:5" "≡E"(2))
1635  AOT_hence α 𝒜(φ{α}  ψ{α}) by (rule "∀I")
1636  AOT_thus 𝒜α(φ{α}  ψ{α})
1637    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(2)] by fast
1638qed
1639
1640AOT_act_theorem "act-quant-uniq": β(𝒜φ{β}  β = α)  β(φ{β}  β = α)
1641proof(rule "≡I"; rule "→I")
1642  AOT_assume β(𝒜φ{β}  β = α)
1643  AOT_hence 𝒜φ{β}  β = α for β using "∀E" by blast
1644  AOT_hence φ{β}  β = α for β
1645    using "≡I" "→I" "RA[1]" "≡E"(1) "≡E"(2) "logic-actual"[act_axiom_inst] "vdash-properties:6"
1646    by metis
1647  AOT_thus β(φ{β}  β = α) by (rule "∀I")
1648next
1649  AOT_assume β(φ{β}  β = α)
1650  AOT_hence φ{β}  β = α for β using "∀E" by blast
1651  AOT_hence 𝒜φ{β}  β = α for β
1652    using "≡I" "→I" "RA[1]" "≡E"(1) "≡E"(2) "logic-actual"[act_axiom_inst] "vdash-properties:6"
1653    by metis
1654  AOT_thus β(𝒜φ{β}  β = α) by (rule "∀I")
1655qed
1656
1657AOT_act_theorem "fund-cont-desc": x = ιx(φ{x})  z(φ{z}  z = x)
1658  using descriptions[axiom_inst] "act-quant-uniq" "≡E"(5) by fast
1659
1660AOT_act_theorem hintikka: x = ιx(φ{x})  (φ{x} & z (φ{z}  z = x))
1661  using "Commutativity of ≡"[THEN "≡E"(1)] "term-out:3" "fund-cont-desc" "≡E"(5) by blast
1662
1663
1664locale russel_axiom =
1665  fixes ψ
1666  assumes ψ_denotes_asm: "[v  ψ{κ}]  [v  κ]"
1667begin
1668AOT_act_theorem "russell-axiom": ψ{ιx φ{x}}  x(φ{x} & z(φ{z}  z = x) & ψ{x})
1669proof -
1670  AOT_have b: x (x = ιx φ{x}  (φ{x} & z(φ{z}  z = x)))
1671    using hintikka "∀I" by fast
1672  show ?thesis
1673  proof(rule "≡I"; rule "→I")
1674    AOT_assume c: ψ{ιx φ{x}}
1675    AOT_hence d: ιx φ{x} using ψ_denotes_asm by blast
1676    AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1677    then AOT_obtain a where a_def: a = ιx φ{x} using "instantiation"[rotated] by blast
1678    moreover AOT_have a = ιx φ{x}  (φ{a} & z(φ{z}  z = a)) using b "∀E" by blast
1679    ultimately AOT_have φ{a} & z(φ{z}  z = a) using "≡E" by blast
1680    moreover AOT_have ψ{a}
1681    proof - 
1682      AOT_have 1: xy(x = y  y = x)
1683        by (simp add: "id-eq:2" "universal-cor")
1684      AOT_have a = ιx φ{x}   ιx φ{x} = a
1685        by (rule "∀E"(1)[where τ="«ιx φ{x}»"]; rule "∀E"(2)[where β=a])
1686           (auto simp: 1 d "universal-cor")
1687      AOT_thus ψ{a}
1688        using a_def c "rule=E" "→E" by blast
1689    qed
1690    ultimately AOT_have φ{a} & z(φ{z}  z = a) & ψ{a} by (rule "&I")
1691    AOT_thus x(φ{x} & z(φ{z}  z = x) & ψ{x}) by (rule "∃I")
1692  next
1693    AOT_assume x(φ{x} & z(φ{z}  z = x) & ψ{x})
1694    then AOT_obtain b where g: φ{b} & z(φ{z}  z = b) & ψ{b} using "instantiation"[rotated] by blast
1695    AOT_hence h: b = ιx φ{x}  (φ{b} & z(φ{z}  z = b)) using b "∀E" by blast
1696    AOT_have φ{b} & z(φ{z}  z = b) and j: ψ{b} using g "&E" by blast+
1697    AOT_hence b = ιx φ{x} using h "≡E" by blast
1698    AOT_thus ψ{ιx φ{x}} using j "rule=E" by blast
1699  qed
1700qed
1701end
1702
1703(* TODO: this nicely shows off using locales with the embedding, but maybe there is still a nicer way *)
1704(* TODO: sledgehammer tends to refer to ψ_denotes_asm in these instantiation instead of referring
1705         to cqt:5:a - should be fixed *)
1706interpretation "russell-axiom[exe,1]": russel_axiom λ κ . «[Π]κ»
1707  by standard (metis "cqt:5:a[1]"[axiom_inst, THEN "→E"] "&E"(2))
1708interpretation "russell-axiom[exe,2,1,1]": russel_axiom λ κ . «[Π]κκ'»
1709  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E")
1710interpretation "russell-axiom[exe,2,1,2]": russel_axiom λ κ . «[Π]κ'κ»
1711  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E"(2))
1712interpretation "russell-axiom[exe,2,2]": russel_axiom λ κ . «[Π]κκ»
1713  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E"(2))
1714interpretation "russell-axiom[exe,3,1,1]": russel_axiom λ κ . «[Π]κκ'κ''»
1715  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1716interpretation "russell-axiom[exe,3,1,2]": russel_axiom λ κ . «[Π]κ'κκ''»
1717  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1718interpretation "russell-axiom[exe,3,1,3]": russel_axiom λ κ . «[Π]κ'κ''κ»
1719  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1720interpretation "russell-axiom[exe,3,2,1]": russel_axiom λ κ . «[Π]κκκ'»
1721  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1722interpretation "russell-axiom[exe,3,2,2]": russel_axiom λ κ . «[Π]κκ'κ»
1723  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1724interpretation "russell-axiom[exe,3,2,3]": russel_axiom λ κ . «[Π]κ'κκ»
1725  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1726interpretation "russell-axiom[exe,3,3]": russel_axiom λ κ . «[Π]κκκ»
1727  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1728
1729interpretation "russell-axiom[enc,1]": russel_axiom λ κ . «κ[Π]»
1730  by standard (metis "cqt:5:b[1]"[axiom_inst, THEN "→E"] "&E"(2))
1731interpretation "russell-axiom[enc,2,1]": russel_axiom λ κ . «κκ'[Π]»
1732  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E")
1733interpretation "russell-axiom[enc,2,2]": russel_axiom λ κ . «κ'κ[Π]»
1734  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E"(2))
1735interpretation "russell-axiom[enc,2,3]": russel_axiom λ κ . «κκ[Π]»
1736  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E"(2))
1737interpretation "russell-axiom[enc,3,1,1]": russel_axiom λ κ . «κκ'κ''[Π]»
1738  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1739interpretation "russell-axiom[enc,3,1,2]": russel_axiom λ κ . «κ'κκ''[Π]»
1740  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1741interpretation "russell-axiom[enc,3,1,3]": russel_axiom λ κ . «κ'κ''κ[Π]»
1742  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1743interpretation "russell-axiom[enc,3,2,1]": russel_axiom λ κ . «κκκ'[Π]»
1744  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1745interpretation "russell-axiom[enc,3,2,2]": russel_axiom λ κ . «κκ'κ[Π]»
1746  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1747interpretation "russell-axiom[enc,3,2,3]": russel_axiom λ κ . «κ'κκ[Π]»
1748  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1749interpretation "russell-axiom[enc,3,3]": russel_axiom λ κ . «κκκ[Π]»
1750  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1751
1752AOT_act_theorem "1-exists:1": ιx φ{x}  ∃!x φ{x}
1753proof(rule "≡I"; rule "→I")
1754  AOT_assume ιx φ{x}
1755  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1756  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1757  AOT_hence φ{a} & z (φ{z}  z = a) using hintikka "≡E" by blast
1758  AOT_hence x (φ{x} & z (φ{z}  z = x)) by (rule "∃I")
1759  AOT_thus ∃!x φ{x} using "uniqueness:1"[THEN "≡dfI"] by blast
1760next
1761  AOT_assume ∃!x φ{x}
1762  AOT_hence x (φ{x} & z (φ{z}  z = x))
1763    using "uniqueness:1"[THEN "≡dfE"] by blast
1764  then AOT_obtain b where φ{b} & z (φ{z}  z = b) using "instantiation"[rotated] by blast
1765  AOT_hence b = ιx φ{x} using hintikka "≡E" by blast
1766  AOT_thus ιx φ{x} by (metis "t=t-proper:2" "vdash-properties:6")
1767qed
1768
1769AOT_act_theorem "1-exists:2": y(y=ιx φ{x})  ∃!x φ{x}
1770  using "1-exists:1" "free-thms:1" "≡E"(6) by blast
1771
1772AOT_act_theorem "y-in:1": x = ιx φ{x}  φ{x}
1773  using "&E"(1) "→I" hintikka "≡E"(1) by blast
1774
1775AOT_act_theorem "y-in:2": z = ιx φ{x}  φ{z} using "y-in:1". (* TODO: same as above *)
1776
1777AOT_act_theorem "y-in:3": ιx φ{x}  φ{ιx φ{x}}
1778proof(rule "→I")
1779  AOT_assume ιx φ{x}
1780  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1781  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1782  moreover AOT_have φ{a} using calculation hintikka "≡E"(1) "&E" by blast
1783  ultimately AOT_show φ{ιx φ{x}} using "rule=E" by blast
1784qed
1785
1786AOT_act_theorem "y-in:4": y (y = ιx φ{x})  φ{ιx φ{x}}
1787  using "y-in:3"[THEN "→E"] "free-thms:1"[THEN "≡E"(2)] "→I" by blast
1788
1789
1790AOT_theorem "act-quant-nec": β (𝒜φ{β}  β = α)  β(𝒜𝒜φ{β}  β = α)
1791proof(rule "≡I"; rule "→I")
1792  AOT_assume β (𝒜φ{β}  β = α)
1793  AOT_hence 𝒜φ{β}  β = α for β using "∀E" by blast
1794  AOT_hence 𝒜𝒜φ{β}  β = α for β 
1795    by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(5))
1796  AOT_thus β(𝒜𝒜φ{β}  β = α)
1797    by (rule "∀I")
1798next
1799  AOT_assume β(𝒜𝒜φ{β}  β = α)
1800  AOT_hence 𝒜𝒜φ{β}  β = α for β using "∀E" by blast
1801  AOT_hence 𝒜φ{β}  β = α for β
1802    by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(6))
1803  AOT_thus β (𝒜φ{β}  β = α)
1804    by (rule "∀I")
1805qed
1806
1807AOT_theorem "equi-desc-descA:1": x = ιx φ{x}  x = ιx(𝒜φ{x})
1808proof -
1809  AOT_have x = ιx φ{x}  z (𝒜φ{z}  z = x)  using descriptions[axiom_inst] by blast
1810  also AOT_have ...  z (𝒜𝒜φ{z}  z = x)
1811  proof(rule "≡I"; rule "→I"; rule "∀I")
1812    AOT_assume z (𝒜φ{z}  z = x)
1813    AOT_hence 𝒜φ{a}  a = x for a using "∀E" by blast
1814    AOT_thus 𝒜𝒜φ{a}  a = x for a by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(5))
1815  next
1816    AOT_assume z (𝒜𝒜φ{z}  z = x)
1817    AOT_hence 𝒜𝒜φ{a}  a = x for a using "∀E" by blast
1818    AOT_thus 𝒜φ{a}  a = x for a  by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(6))
1819  qed
1820  also AOT_have ...  x = ιx(𝒜φ{x})
1821    using "Commutativity of ≡"[THEN "≡E"(1)] descriptions[axiom_inst] by fast
1822  finally show ?thesis .
1823qed
1824
1825AOT_theorem "equi-desc-descA:2": ιx φ{x}  ιx φ{x} = ιx(𝒜φ{x})
1826proof(rule "→I")
1827  AOT_assume ιx φ{x}
1828  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1829  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1830  moreover AOT_have a = ιx(𝒜φ{x}) using calculation "equi-desc-descA:1"[THEN "≡E"(1)] by blast
1831  ultimately AOT_show ιx φ{x} = ιx(𝒜φ{x}) using "rule=E" by fast
1832qed
1833
1834AOT_theorem "nec-hintikka-scheme": x = ιx φ{x}  𝒜φ{x} & z(𝒜φ{z}  z = x)
1835proof -
1836  AOT_have x = ιx φ{x}  z(𝒜φ{z}  z = x) using descriptions[axiom_inst] by blast
1837  also AOT_have   (𝒜φ{x} & z(𝒜φ{z}  z = x))
1838    using "Commutativity of ≡"[THEN "≡E"(1)] "term-out:3" by fast
1839  finally show ?thesis.
1840qed
1841
1842AOT_theorem "equiv-desc-eq:1": 𝒜x(φ{x}  ψ{x})  x (x = ιx φ{x}  x = ιx ψ{x})
1843proof(rule "→I"; rule "∀I")
1844  fix β
1845  AOT_assume 𝒜x(φ{x}  ψ{x})
1846  AOT_hence 𝒜(φ{x}  ψ{x}) for x using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(1)] "∀E"(2) by blast
1847  AOT_hence 0: 𝒜φ{x}  𝒜ψ{x} for x by (metis "Act-Basic:5" "≡E"(1))
1848  AOT_have β = ιx φ{x}  𝒜φ{β} & z(𝒜φ{z}  z = β) using "nec-hintikka-scheme" by blast
1849  also AOT_have ...  𝒜ψ{β} & z(𝒜ψ{z}  z = β)
1850  proof (rule "≡I"; rule "→I")
1851    AOT_assume 1: 𝒜φ{β} & z(𝒜φ{z}  z = β)
1852    AOT_hence 𝒜φ{z}  z = β for z using "&E" "∀E" by blast
1853    AOT_hence 𝒜ψ{z}  z = β for z using 0 "≡E" "→I" "→E" by metis
1854    AOT_hence z(𝒜ψ{z}  z = β) using "∀I" by fast
1855    moreover AOT_have 𝒜ψ{β} using "&E" 0[THEN "≡E"(1)] 1 by blast
1856    ultimately AOT_show 𝒜ψ{β} & z(𝒜ψ{z}  z = β) using "&I" by blast
1857  next
1858    AOT_assume 1: 𝒜ψ{β} & z(𝒜ψ{z}  z = β)
1859    AOT_hence 𝒜ψ{z}  z = β for z using "&E" "∀E" by blast
1860    AOT_hence 𝒜φ{z}  z = β for z using 0 "≡E" "→I" "→E" by metis
1861    AOT_hence z(𝒜φ{z}  z = β) using "∀I" by fast
1862    moreover AOT_have 𝒜φ{β} using "&E" 0[THEN "≡E"(2)] 1 by blast
1863    ultimately AOT_show 𝒜φ{β} & z(𝒜φ{z}  z = β) using "&I" by blast
1864  qed
1865  also AOT_have ...  β = ιx ψ{x}
1866    using "Commutativity of ≡"[THEN "≡E"(1)] "nec-hintikka-scheme" by blast
1867  finally AOT_show β = ιx φ{x}  β = ιx ψ{x} .
1868qed
1869
1870AOT_theorem "equiv-desc-eq:2": ιx φ{x} & 𝒜x(φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1871proof(rule "→I")
1872  AOT_assume ιx φ{x} & 𝒜x(φ{x}  ψ{x})
1873  AOT_hence 0: y (y = ιx φ{x}) and
1874            1: x (x = ιx φ{x}  x = ιx ψ{x})
1875    using "&E" "free-thms:1"[THEN "≡E"(1)] "equiv-desc-eq:1" "→E" by blast+
1876  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1877  moreover AOT_have a = ιx ψ{x} using calculation 1 "∀E" "≡E"(1) by fast
1878  ultimately AOT_show ιx φ{x} = ιx ψ{x}
1879    using "rule=E" by fast
1880qed
1881
1882AOT_theorem "equiv-desc-eq:3": ιx φ{x} & x(φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1883  using "→I" "equiv-desc-eq:2"[THEN "→E", OF "&I"] "&E" "nec-imp-act"[THEN "→E"] by metis
1884
1885(* Note: this is a special case of "exist-nec" *)
1886AOT_theorem "equiv-desc-eq:4": ιx φ{x}  ιx φ{x}
1887proof(rule "→I")
1888  AOT_assume ιx φ{x}
1889  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1890  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1891  AOT_thus ιx φ{x}
1892    using "ex:2:a" "rule=E" by fast
1893qed
1894
1895AOT_theorem "equiv-desc-eq:5": ιx φ{x}  y (y = ιx φ{x})
1896proof(rule "→I")
1897  AOT_assume ιx φ{x}
1898  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1899  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1900  AOT_hence (a = ιx φ{x}) by (metis "id-nec:2" "vdash-properties:10")
1901  AOT_thus y (y = ιx φ{x}) by (rule "∃I")
1902qed
1903
1904AOT_act_theorem "equiv-desc-eq2:1": x (φ{x}  ψ{x})  x (x = ιx φ{x}  x = ιx ψ{x})
1905  using "→I" "logic-actual"[act_axiom_inst, THEN "→E"] "equiv-desc-eq:1"[THEN "→E"]
1906        "RA[1]" "deduction-theorem" by blast
1907
1908AOT_act_theorem "equiv-desc-eq2:2": ιx φ{x} & x (φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1909  using "→I" "logic-actual"[act_axiom_inst, THEN "→E"] "equiv-desc-eq:2"[THEN "→E", OF "&I"]
1910        "RA[1]" "deduction-theorem" "&E" by metis
1911
1912context russel_axiom
1913begin
1914AOT_theorem "nec-russell-axiom": ψ{ιx φ{x}}  x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x})
1915proof -
1916  AOT_have b: x (x = ιx φ{x}  (𝒜φ{x} & z(𝒜φ{z}  z = x)))
1917    using "nec-hintikka-scheme" "∀I" by fast
1918  show ?thesis
1919  proof(rule "≡I"; rule "→I")
1920    AOT_assume c: ψ{ιx φ{x}}
1921    AOT_hence d: ιx φ{x} using ψ_denotes_asm by blast
1922    AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1923    then AOT_obtain a where a_def: a = ιx φ{x} using "instantiation"[rotated] by blast
1924    moreover AOT_have a = ιx φ{x}  (𝒜φ{a} & z(𝒜φ{z}  z = a)) using b "∀E" by blast
1925    ultimately AOT_have 𝒜φ{a} & z(𝒜φ{z}  z = a) using "≡E" by blast
1926    moreover AOT_have ψ{a}
1927    proof - 
1928      AOT_have 1: xy(x = y  y = x)
1929        by (simp add: "id-eq:2" "universal-cor")
1930      AOT_have a = ιx φ{x}   ιx φ{x} = a
1931        by (rule "∀E"(1)[where τ="«ιx φ{x}»"]; rule "∀E"(2)[where β=a])
1932           (auto simp: d "universal-cor" 1)
1933      AOT_thus ψ{a}
1934        using a_def c "rule=E" "→E" by metis
1935    qed
1936    ultimately AOT_have 𝒜φ{a} & z(𝒜φ{z}  z = a) & ψ{a} by (rule "&I")
1937    AOT_thus x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x}) by (rule "∃I")
1938  next
1939    AOT_assume x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x})
1940    then AOT_obtain b where g: 𝒜φ{b} & z(𝒜φ{z}  z = b) & ψ{b} using "instantiation"[rotated] by blast
1941    AOT_hence h: b = ιx φ{x}  (𝒜φ{b} & z(𝒜φ{z}  z = b)) using b "∀E" by blast
1942    AOT_have 𝒜φ{b} & z(𝒜φ{z}  z = b) and j: ψ{b} using g "&E" by blast+
1943    AOT_hence b = ιx φ{x} using h "≡E" by blast
1944    AOT_thus ψ{ιx φ{x}} using j "rule=E" by blast
1945  qed
1946qed
1947end
1948
1949AOT_theorem "actual-desc:1": ιx φ{x}  ∃!x 𝒜φ{x}
1950proof (rule "≡I"; rule "→I")
1951  AOT_assume ιx φ{x}
1952  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1953  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1954  moreover AOT_have a = ιx φ{x}  z(𝒜φ{z}  z = a)
1955    using descriptions[axiom_inst] by blast
1956  ultimately AOT_have z(𝒜φ{z}  z = a)
1957    using "≡E" by blast
1958  AOT_hence xz(𝒜φ{z}  z = x) by (rule "∃I")
1959  AOT_thus ∃!x 𝒜φ{x}
1960    using "uniqueness:2"[THEN "≡E"(2)] by fast
1961next
1962  AOT_assume ∃!x 𝒜φ{x}
1963  AOT_hence xz(𝒜φ{z}  z = x)
1964    using "uniqueness:2"[THEN "≡E"(1)] by fast
1965  then AOT_obtain a where z(𝒜φ{z}  z = a) using "instantiation"[rotated] by blast
1966  moreover AOT_have a = ιx φ{x}  z(𝒜φ{z}  z = a)
1967    using descriptions[axiom_inst] by blast
1968  ultimately AOT_have a = ιx φ{x} using "≡E" by blast
1969  AOT_thus ιx φ{x} by (metis "t=t-proper:2" "vdash-properties:6")
1970qed
1971
1972AOT_theorem "actual-desc:2": x = ιx φ{x}  𝒜φ{x}
1973  using "&E"(1) "contraposition:1[2]" "≡E"(1) "nec-hintikka-scheme" "reductio-aa:2" "vdash-properties:9" by blast
1974
1975AOT_theorem "actual-desc:3": z = ιx φ{x}  𝒜φ{z}
1976  using "actual-desc:2". (* TODO: same as above *)
1977
1978AOT_theorem "actual-desc:4": ιx φ{x}  𝒜φ{ιx φ{x}}
1979proof(rule "→I")
1980  AOT_assume ιx φ{x}
1981  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1982  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1983  AOT_thus 𝒜φ{ιx φ{x}}
1984    using "actual-desc:2" "rule=E" "→E" by fast
1985qed
1986
1987(* TODO: take another look at proof in PLM *)
1988AOT_theorem "actual-desc:5": ιx φ{x} = ιx ψ{x}  𝒜x(φ{x}  ψ{x})
1989proof(rule "→I")
1990  AOT_assume 0: ιx φ{x} = ιx ψ{x}
1991  AOT_hence φ_down: ιx φ{x} and ψ_down: ιx ψ{x}
1992    using "t=t-proper:1" "t=t-proper:2" "vdash-properties:6" by blast+
1993  AOT_hence y (y = ιx φ{x}) and y (y = ιx ψ{x}) by (metis "rule=I:1" "existential:1")+
1994  then AOT_obtain a and b where a_eq: a = ιx φ{x} and b_eq: b = ιx ψ{x}
1995    using "instantiation"[rotated] by metis
1996
1997  AOT_have αβ (α = β  β = α) by (rule "∀I"; rule "∀I"; rule "id-eq:2")
1998  AOT_hence β (ιx φ{x} = β  β = ιx φ{x})
1999    using "∀E" φ_down by blast
2000  AOT_hence ιx φ{x} = ιx ψ{x}  ιx ψ{x} = ιx φ{x}
2001    using "∀E" ψ_down by blast
2002  AOT_hence 1: ιx ψ{x} = ιx φ{x} using 0
2003    "→E" by blast
2004
2005  AOT_have 𝒜φ{x}  𝒜ψ{x} for x
2006  proof(rule "≡I"; rule "→I")
2007    AOT_assume 𝒜φ{x}
2008    moreover AOT_have 𝒜φ{x}  x = a for x
2009      using "nec-hintikka-scheme"[THEN "≡E"(1), OF a_eq, THEN "&E"(2)] "∀E" by blast
2010    ultimately AOT_have x = a using "→E" by blast
2011    AOT_hence x = ιx φ{x} using a_eq "rule=E" by blast
2012    AOT_hence x = ιx ψ{x} using 0 "rule=E" by blast
2013    AOT_thus 𝒜ψ{x} by (metis "actual-desc:3" "vdash-properties:6")
2014  next
2015    AOT_assume 𝒜ψ{x}
2016    moreover AOT_have 𝒜ψ{x}  x = b for x
2017      using "nec-hintikka-scheme"[THEN "≡E"(1), OF b_eq, THEN "&E"(2)] "∀E" by blast
2018    ultimately AOT_have x = b using "→E" by blast
2019    AOT_hence x = ιx ψ{x} using b_eq "rule=E" by blast
2020    AOT_hence x = ιx φ{x} using 1 "rule=E" by blast
2021    AOT_thus 𝒜φ{x} by (metis "actual-desc:3" "vdash-properties:6")
2022  qed
2023  AOT_hence 𝒜(φ{x}  ψ{x}) for x by (metis "Act-Basic:5" "≡E"(2))
2024  AOT_hence x 𝒜(φ{x}  ψ{x}) by (rule "∀I")
2025  AOT_thus 𝒜x (φ{x}  ψ{x})
2026    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(2)] by fast
2027qed    
2028
2029AOT_theorem "!box-desc:1": ∃!x φ{x}  y (y = ιx φ{x}  φ{y})
2030proof(rule "→I")
2031  AOT_assume ∃!x φ{x}
2032  AOT_hence ζ: x (φ{x} & z (φ{z}  z = x))
2033    using "uniqueness:1"[THEN "≡dfE"] by blast
2034  then AOT_obtain b where θ: φ{b} & z (φ{z}  z = b) using "instantiation"[rotated] by blast
2035  AOT_show y (y = ιx φ{x}  φ{y})
2036  proof(rule GEN; rule "→I")
2037    fix y
2038    AOT_assume y = ιx φ{x}
2039    AOT_hence 𝒜φ{y} & z (𝒜φ{z}  z = y) using "nec-hintikka-scheme"[THEN "≡E"(1)] by blast
2040    AOT_hence 𝒜φ{b}  b = y using "&E" "∀E" by blast
2041    moreover AOT_have 𝒜φ{b} using θ[THEN "&E"(1)]  by (metis "nec-imp-act" "→E")
2042    ultimately AOT_have b = y using "→E" by blast
2043    moreover AOT_have φ{b} using θ[THEN "&E"(1)]  by (metis "qml:2"[axiom_inst] "→E") 
2044    ultimately AOT_show φ{y} using "rule=E" by blast
2045  qed
2046qed
2047
2048AOT_theorem "!box-desc:2": x (φ{x}  φ{x})  (∃!x φ{x}  y (y = ιx φ{x}  φ{y}))
2049proof(rule "→I"; rule "→I")
2050  AOT_assume x (φ{x}  φ{x})
2051  moreover AOT_assume ∃!x φ{x}
2052  ultimately AOT_have ∃!x φ{x}
2053    using "nec-exist-!"[THEN "→E", THEN "→E"] by blast
2054  AOT_thus y (y = ιx φ{x}  φ{y})
2055    using "!box-desc:1" "→E" by blast
2056qed
2057
2058AOT_theorem "dr-alphabetic-thm": ιν φ{ν}  ιν φ{ν} = ιμ φ{μ} (* TODO: vacuous *)
2059  by (simp add: "rule=I:1" "→I")
2060
2061AOT_theorem "RM:1[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2062proof -
2063  AOT_have Γ  (φ  ψ) using "RN[prem]" assms by blast
2064  AOT_thus Γ  φ  ψ by (metis "qml:1"[axiom_inst] "→E")
2065qed
2066
2067AOT_theorem "RM:1": assumes  φ  ψ shows  φ  ψ
2068  using "RM:1[prem]" assms by blast
2069
2070lemmas RM = "RM:1"
2071
2072AOT_theorem "RM:2[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2073proof -
2074  AOT_have Γ  ¬ψ  ¬φ using assms 
2075    by (simp add: "contraposition:1[1]")
2076  AOT_hence Γ  ¬ψ  ¬φ using "RM:1[prem]" by blast
2077  AOT_thus Γ  φ  ψ
2078    by (meson "≡dfE" "≡dfI" "conventions:5" "deduction-theorem" "modus-tollens:1")
2079qed
2080
2081AOT_theorem "RM:2": assumes  φ  ψ shows  φ  ψ
2082  using "RM:2[prem]" assms by blast
2083
2084lemmas "RM◇" = "RM:2"
2085
2086AOT_theorem "RM:3[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2087proof -
2088  AOT_have Γ  φ  ψ and Γ  ψ  φ using assms "≡E" "→I" by metis+
2089  AOT_hence Γ  φ  ψ and Γ  ψ  φ using "RM:1[prem]" by metis+
2090  AOT_thus Γ  φ  ψ
2091    by (simp add: "≡I")
2092qed
2093
2094AOT_theorem "RM:3": assumes  φ  ψ shows  φ  ψ
2095  using "RM:3[prem]" assms by blast
2096
2097lemmas RE = "RM:3"
2098
2099AOT_theorem "RM:4[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2100proof -
2101  AOT_have Γ  φ  ψ and Γ  ψ  φ using assms "≡E" "→I" by metis+
2102  AOT_hence Γ  φ  ψ and Γ  ψ  φ using "RM:2[prem]" by metis+
2103  AOT_thus Γ  φ  ψ by (simp add: "≡I")
2104qed
2105
2106AOT_theorem "RM:4": assumes  φ  ψ shows  φ  ψ
2107  using "RM:4[prem]" assms by blast
2108
2109lemmas "RE◇" = "RM:4"
2110
2111AOT_theorem "KBasic:1": φ  (ψ  φ)
2112  by (simp add: RM "pl:1"[axiom_inst])
2113
2114AOT_theorem "KBasic:2": ¬φ  (φ  ψ)
2115  by (simp add: RM "useful-tautologies:3")
2116
2117AOT_theorem "KBasic:3": (φ & ψ)  (φ & ψ)
2118proof (rule "≡I"; rule "→I")
2119  AOT_assume (φ & ψ)
2120  AOT_thus φ & ψ
2121    by (meson RM "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "vdash-properties:6")
2122next
2123  AOT_have φ  (ψ  (φ & ψ)) by (simp add: "RM:1" Adjunction)
2124  AOT_hence φ  (ψ  (φ & ψ))  by (metis "Hypothetical Syllogism" "qml:1"[axiom_inst])
2125  moreover AOT_assume φ & ψ
2126  ultimately AOT_show (φ & ψ)
2127    using "→E" "&E" by blast
2128qed
2129
2130AOT_theorem "KBasic:4": (φ  ψ)  ((φ  ψ) & (ψ  φ))
2131proof -
2132  AOT_have θ: ((φ  ψ) & (ψ  φ))  ((φ  ψ) & (ψ  φ))
2133    by (fact "KBasic:3")
2134  AOT_modally_strict {
2135    AOT_have (φ  ψ)  ((φ  ψ) & (ψ  φ))
2136      by (fact "conventions:3"[THEN "≡Df"])
2137  }
2138  AOT_hence ξ: (φ  ψ)  ((φ  ψ) & (ψ  φ))
2139    by (rule RE)
2140  with ξ and θ AOT_show (φ  ψ)  ((φ  ψ) & (ψ  φ))
2141    using "≡E"(5) by blast
2142qed
2143
2144AOT_theorem "KBasic:5": ((φ  ψ) & (ψ  φ))  (φ  ψ)
2145proof -
2146  AOT_have (φ  ψ)  (φ  ψ)
2147    by (fact "qml:1"[axiom_inst])
2148  moreover AOT_have (ψ  φ)  (ψ  φ)
2149    by (fact "qml:1"[axiom_inst])
2150  ultimately AOT_have ((φ  ψ) & (ψ  φ))  ((φ  ψ) & (ψ  φ))
2151    by (metis "&I" MP "Double Composition")
2152  moreover AOT_have ((φ  ψ) & (ψ  φ))  (φ  ψ)
2153    using "conventions:3"[THEN "≡dfI"] "→I" by blast
2154  ultimately AOT_show ((φ  ψ) & (ψ  φ))  (φ  ψ)
2155    by (metis "Hypothetical Syllogism")
2156qed
2157
2158AOT_theorem "KBasic:6": (φ ψ)  (φ  ψ)
2159  using "KBasic:4" "KBasic:5" "deduction-theorem" "≡E"(1) "vdash-properties:10" by blast
2160AOT_theorem "KBasic:7": ((φ & ψ)  (¬φ & ¬ψ))  (φ  ψ)
2161proof (rule "→I"; drule "∨E"(1); (rule "→I")?)
2162  AOT_assume φ & ψ
2163  AOT_hence φ and ψ using "&E" by blast+
2164  AOT_hence (φ  ψ) and (ψ  φ) using "KBasic:1" "→E" by blast+
2165  AOT_hence (φ  ψ) & (ψ  φ) using "&I" by blast
2166  AOT_thus (φ  ψ)  by (metis "KBasic:4" "≡E"(2))
2167next
2168  AOT_assume ¬φ & ¬ψ
2169  AOT_hence 0: (¬φ & ¬ψ) using "KBasic:3"[THEN "≡E"(2)] by blast
2170  AOT_modally_strict {
2171    AOT_have (¬φ & ¬ψ)  (φ  ψ)
2172      by (metis "&E"(1) "&E"(2) "deduction-theorem" "≡I" "reductio-aa:1")
2173  }
2174  AOT_hence (¬φ & ¬ψ)  (φ  ψ)
2175    by (rule RM)
2176  AOT_thus (φ  ψ) using 0 "→E" by blast
2177qed(auto)
2178
2179AOT_theorem "KBasic:8": (φ & ψ)  (φ  ψ)
2180  by (meson "RM:1" "&E"(1) "&E"(2) "deduction-theorem" "≡I")
2181AOT_theorem "KBasic:9": (¬φ & ¬ψ)  (φ  ψ)
2182  by (metis "RM:1" "&E"(1) "&E"(2) "deduction-theorem" "≡I" "raa-cor:4")
2183AOT_theorem "KBasic:10": φ  ¬¬φ
2184  by (simp add: "RM:3" "oth-class-taut:3:b")
2185AOT_theorem "KBasic:11": ¬φ  ¬φ
2186proof (rule "≡I"; rule "→I")
2187  AOT_show ¬φ if ¬φ
2188    using that "≡dfI" "conventions:5" "KBasic:10" "≡E"(3) by blast
2189next
2190  AOT_show ¬φ if ¬φ
2191    using "≡dfE" "conventions:5" "KBasic:10" "≡E"(4) that by blast
2192qed
2193AOT_theorem "KBasic:12": φ  ¬¬φ
2194proof (rule "≡I"; rule "→I")
2195  AOT_show ¬¬φ if φ
2196    using "¬¬I" "KBasic:11" "≡E"(3) that by blast
2197next
2198  AOT_show φ if ¬¬φ
2199  using "KBasic:11" "≡E"(1) "reductio-aa:1" that by blast
2200qed
2201AOT_theorem "KBasic:13": (φ  ψ)  (φ  ψ)
2202proof -
2203  AOT_have φ  ψ  φ  ψ by blast
2204  AOT_hence (φ  ψ)  φ  ψ
2205    using "RM:2[prem]" by blast
2206  AOT_thus (φ  ψ)  (φ  ψ) using "→I" by blast
2207qed
2208lemmas "K◇" = "KBasic:13"
2209AOT_theorem "KBasic:14": φ  ¬¬φ
2210  by (meson "RE◇" "KBasic:11" "KBasic:12" "≡E"(6) "oth-class-taut:3:a")
2211AOT_theorem "KBasic:15": (φ  ψ)  (φ  ψ)
2212proof -
2213  AOT_modally_strict {
2214    AOT_have φ  (φ  ψ) and ψ  (φ  ψ)
2215      by (auto simp: "Disjunction Addition"(1) "Disjunction Addition"(2))
2216  }
2217  AOT_hence φ  (φ  ψ) and ψ  (φ  ψ)
2218    using RM by blast+
2219  AOT_thus (φ  ψ)  (φ  ψ)
2220    by (metis "∨E"(1) "deduction-theorem")
2221qed
2222
2223AOT_theorem "KBasic:16": (φ & ψ)  (φ & ψ)
2224  by (meson "KBasic:13" "RM:1" Adjunction "Hypothetical Syllogism" Importation "vdash-properties:6")
2225
2226AOT_theorem "rule-sub-lem:1:a":
2227  assumes  (ψ  χ)
2228  shows  ¬ψ  ¬χ
2229  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2230        "≡E"(1) "oth-class-taut:4:b" by blast
2231
2232AOT_theorem "rule-sub-lem:1:b":
2233  assumes  (ψ  χ)
2234  shows  (ψ  Θ)  (χ  Θ)
2235  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2236  using "oth-class-taut:4:c" "vdash-properties:6" by blast
2237
2238AOT_theorem "rule-sub-lem:1:c":
2239  assumes  (ψ  χ)
2240  shows  (Θ  ψ)  (Θ  χ)
2241  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2242  using "oth-class-taut:4:d" "vdash-properties:6" by blast
2243
2244AOT_theorem "rule-sub-lem:1:d":
2245  assumes for arbitrary α:  (ψ{α}  χ{α})
2246  shows  α ψ{α}  α χ{α}
2247proof -
2248  AOT_modally_strict {
2249    AOT_have α (ψ{α}  χ{α})
2250      using "qml:2"[axiom_inst, THEN "→E", OF assms] "∀I" by fast
2251    AOT_hence 0: ψ{α}  χ{α} for α using "∀E" by blast
2252    AOT_show α ψ{α}  α χ{α}
2253    proof (rule "≡I"; rule "→I")
2254      AOT_assume α ψ{α}
2255      AOT_hence ψ{α} for α using "∀E" by blast
2256      AOT_hence χ{α} for α using 0 "≡E" by blast
2257      AOT_thus α χ{α} by (rule "∀I")
2258    next
2259      AOT_assume α χ{α}
2260      AOT_hence χ{α} for α using "∀E" by blast
2261      AOT_hence ψ{α} for α using 0 "≡E" by blast
2262      AOT_thus α ψ{α} by (rule "∀I")
2263    qed
2264  }
2265qed
2266
2267AOT_theorem "rule-sub-lem:1:e":
2268  assumes  (ψ  χ)
2269  shows   ψ]   χ]
2270  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2271  using "≡E"(1) "propositions-lemma:6" by blast
2272
2273AOT_theorem "rule-sub-lem:1:f":
2274  assumes  (ψ  χ)
2275  shows  𝒜ψ  𝒜χ
2276  using "qml:2"[axiom_inst, THEN "→E", OF assms, THEN "RA[2]"]
2277  by (metis "Act-Basic:5" "≡E"(1))
2278
2279AOT_theorem "rule-sub-lem:1:g":
2280  assumes  (ψ  χ)
2281  shows  ψ  χ
2282  using "KBasic:6" assms "vdash-properties:6" by blast
2283
2284text‹Note that instead of deriving @{text "rule-sub-lem:2"}, @{text "rule-sub-lem:3"}, @{text "rule-sub-lem:4"},
2285     and @{text "rule-sub-nec"}, we construct substitution methods instead.›
2286
2287class AOT_subst =
2288  fixes AOT_subst :: "('a  𝗈)  bool"
2289    and AOT_subst_cond :: "'a  'a  bool"
2290  assumes AOT_subst: "AOT_subst φ  AOT_subst_cond ψ χ  [v  «φ ψ»  «φ χ»]"
2291
2292named_theorems AOT_substI
2293
2294instantiation 𝗈 :: AOT_subst
2295begin
2296
2297inductive AOT_subst_𝗈 where
2298  AOT_subst_𝗈_id[AOT_substI]: "AOT_subst_𝗈 (λφ. φ)"
2299| AOT_subst_𝗈_const[AOT_substI]: "AOT_subst_𝗈 (λφ. ψ)"
2300| AOT_subst_𝗈_not[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «¬Θ{φ}»)"
2301| AOT_subst_𝗈_imp[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 Ξ  AOT_subst_𝗈 (λ φ. «Θ{φ}  Ξ{φ}»)"
2302| AOT_subst_𝗈_lambda0[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. (AOT_lambda0 (Θ φ)))"
2303| AOT_subst_𝗈_act[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «𝒜Θ{φ}»)"
2304| AOT_subst_𝗈_box[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «Θ{φ}»)"
2305| AOT_subst_𝗈_by_def[AOT_substI]: "( ψ . AOT_model_equiv_def (Θ ψ) (Ξ ψ))  AOT_subst_𝗈 Ξ  AOT_subst_𝗈 Θ"
2306
2307definition AOT_subst_cond_𝗈 where "AOT_subst_cond_𝗈  λ ψ χ .  v . [v  ψ  χ]"
2308
2309instance
2310proof
2311  fix ψ χ :: 𝗈 and φ :: ‹𝗈  𝗈›
2312  assume cond: ‹AOT_subst_cond ψ χ
2313  assume ‹AOT_subst φ
2314  moreover AOT_have  ψ  χ using cond unfolding AOT_subst_cond_𝗈_def by blast
2315  ultimately AOT_show  φ{ψ}  φ{χ}
2316  proof (induct arbitrary: ψ χ)
2317    case AOT_subst_𝗈_id
2318    thus ?case using "≡E"(2) "oth-class-taut:4:b" "rule-sub-lem:1:a" by blast
2319  next
2320    case (AOT_subst_𝗈_const ψ)
2321    thus ?case by (simp add: "oth-class-taut:3:a")
2322  next
2323    case (AOT_subst_𝗈_not Θ)
2324    thus ?case by (simp add: RN "rule-sub-lem:1:a")
2325  next
2326    case (AOT_subst_𝗈_imp Θ Ξ)
2327    thus ?case by (meson RN "≡E"(5) "rule-sub-lem:1:b" "rule-sub-lem:1:c")
2328  next
2329    case (AOT_subst_𝗈_lambda0 Θ)
2330    thus ?case by (simp add: RN "rule-sub-lem:1:e")
2331  next
2332    case (AOT_subst_𝗈_act Θ)
2333    thus ?case by (simp add: RN "rule-sub-lem:1:f")
2334  next
2335    case (AOT_subst_𝗈_box Θ)
2336    thus ?case by (simp add: RN "rule-sub-lem:1:g")
2337  next
2338    case (AOT_subst_𝗈_by_def Θ Ξ)
2339    AOT_modally_strict {
2340      AOT_have Ξ{ψ}  Ξ{χ} using AOT_subst_𝗈_by_def by simp
2341      AOT_thus Θ{ψ}  Θ{χ}
2342        using "≡Df"[OF AOT_subst_𝗈_by_def(1), of _ ψ] "≡Df"[OF AOT_subst_𝗈_by_def(1), of _ χ]
2343        by (metis "≡E"(6) "oth-class-taut:3:a")
2344    }
2345  qed
2346qed
2347end
2348
2349instantiation "fun" :: (AOT_Term_id_2, AOT_subst) AOT_subst
2350begin
2351
2352definition AOT_subst_cond_fun :: "('a  'b)  ('a  'b)  bool" where
2353  "AOT_subst_cond_fun  λ φ ψ .  α . AOT_subst_cond (φ (AOT_term_of_var α)) (ψ (AOT_term_of_var α))"
2354
2355inductive AOT_subst_fun :: "(('a  'b)  𝗈)  bool" where
2356  AOT_subst_fun_const[AOT_substI]: "AOT_subst_fun (λφ. ψ)"
2357| AOT_subst_fun_id[AOT_substI]: "AOT_subst Ψ  AOT_subst_fun (λφ. Ψ (φ (AOT_term_of_var x)))"
2358| AOT_subst_fun_all[AOT_substI]: "AOT_subst Ψ  ( α . AOT_subst_fun (Θ (AOT_term_of_var α)))  AOT_subst_fun (λφ :: 'a  'b. Ψ «α «Θ (α::'a) φ»»)"
2359| AOT_subst_fun_not[AOT_substI]: "AOT_subst Ψ  AOT_subst_fun (λφ. «¬«Ψ φ»»)"
2360| AOT_subst_fun_imp[AOT_substI]: "AOT_subst Ψ  AOT_subst Θ  AOT_subst_fun (λφ. ««Ψ φ»  «Θ φ»»)"
2361| AOT_subst_fun_lambda0[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. (AOT_lambda0 (Θ φ)))"
2362| AOT_subst_fun_act[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. «𝒜«Θ φ»»)"
2363| AOT_subst_fun_box[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. ««Θ φ»»)"
2364| AOT_subst_fun_def[AOT_substI]: "( φ . AOT_model_equiv_def (Θ φ) (Ψ φ))  AOT_subst_fun Ψ  AOT_subst_fun Θ"
2365
2366instance proof
2367  fix ψ χ :: "'a  'b" and φ :: ('a  'b)  𝗈›
2368  assume ‹AOT_subst φ
2369  moreover assume cond: ‹AOT_subst_cond ψ χ
2370  ultimately AOT_show  «φ ψ»  «φ χ»
2371  proof(induct)
2372    case (AOT_subst_fun_const ψ)
2373    then show ?case by (simp add: "oth-class-taut:3:a")
2374  next
2375  case (AOT_subst_fun_id Ψ x)
2376  then show ?case by (simp add: AOT_subst AOT_subst_cond_fun_def) 
2377  next
2378  case (AOT_subst_fun_all Ψ Θ)
2379  AOT_have  (Θ{α, «ψ»}  Θ{α, «χ»}) for α
2380    using AOT_subst_fun_all.hyps(3) AOT_subst_fun_all.prems RN by presburger
2381  thus ?case using AOT_subst[OF AOT_subst_fun_all(1)]
2382    by (simp add: RN "rule-sub-lem:1:d" AOT_subst_cond_fun_def AOT_subst_cond_𝗈_def)
2383  next
2384  case (AOT_subst_fun_not Ψ)
2385  then show ?case by (simp add: RN "rule-sub-lem:1:a")
2386  next
2387  case (AOT_subst_fun_imp Ψ Θ)
2388  then show ?case 
2389    unfolding AOT_subst_cond_fun_def AOT_subst_cond_𝗈_def
2390    by (meson "≡E"(5) "oth-class-taut:4:c" "oth-class-taut:4:d" "vdash-properties:6")
2391  next
2392  case (AOT_subst_fun_lambda0 Θ)
2393  then show ?case by (simp add: RN "rule-sub-lem:1:e")
2394  next
2395  case (AOT_subst_fun_act Θ)
2396  then show ?case by (simp add: RN "rule-sub-lem:1:f")
2397  next
2398  case (AOT_subst_fun_box Θ)
2399  then show ?case by (simp add: RN "rule-sub-lem:1:g")
2400  next
2401  case (AOT_subst_fun_def Θ Ψ)
2402  then show ?case
2403    by (meson "df-rules-formulas[3]" "df-rules-formulas[4]" "≡I" "≡E"(5))
2404  qed
2405qed
2406end
2407
2408method_setup AOT_defI =
2409‹Scan.lift (Scan.succeed (fn ctxt => (Method.CONTEXT_METHOD (fn thms => (Context_Tactic.CONTEXT_SUBGOAL (fn (trm,int) => 
2410Context_Tactic.CONTEXT_TACTIC (
2411let
2412fun findHeadConst (Const x) = SOME x
2413  | findHeadConst (A $ B) = findHeadConst A
2414  | findHeadConst _ = NONE
2415fun findDef (Const (const_name‹AOT_model_equiv_def›, _) $ lhs $ rhs) = findHeadConst lhs
2416  | findDef (A $ B) = (case findDef A of SOME x => SOME x | _ => findDef B)
2417  | findDef (Abs (a,b,c)) = findDef c
2418  | findDef _ = NONE
2419val const_opt = (findDef trm)
2420val defs = case const_opt of SOME const => List.filter (fn thm => let
2421    val concl = Thm.concl_of thm
2422    val thmconst = (findDef concl)
2423    in case thmconst of SOME (c,_) => fst const = c | _ => false end) (AOT_Definitions.get ctxt)
2424    | _ => []
2425in
2426resolve_tac ctxt defs 1
2427end
2428)) 1)))))
2429‹Resolve AOT definitions›
2430
2431method AOT_subst_intro_helper = ((rule AOT_substI
2432      | AOT_defI
2433      | (simp only: AOT_subst_cond_𝗈_def AOT_subst_cond_fun_def; ((rule allI)+)?)))
2434
2435method AOT_subst for ψ::"'a::AOT_subst" and χ::"'a::AOT_subst" =
2436    (match conclusion in "[v  «φ ψ»]" for φ and v 
2437      match (φ) in "λa . ?p" fail¦ "λa . a" fail2438       ¦ _ rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(2)]
2439       ; (AOT_subst_intro_helper+)?››)
2440
2441method AOT_subst_rev for χ::"'a::AOT_subst" and ψ::"'a::AOT_subst" =
2442    (match conclusion in "[v  «φ ψ»]" for φ and v 
2443      match (φ) in "λa . ?p" fail¦ "λa . a" fail2444       ¦ _ rule AOT_subst[where φ=φ and ψ=χ and χ=ψ, THEN "≡E"(1)]
2445       ; (AOT_subst_intro_helper+)?››)
2446
2447method AOT_subst_manual for φ::"'a::AOT_subst  𝗈" =
2448    (rule AOT_subst[where φ=φ, THEN "≡E"(2)]; (AOT_subst_intro_helper+)?)
2449
2450method AOT_subst_manual_rev for φ::"'a::AOT_subst  𝗈" =
2451    (rule AOT_subst[where φ=φ, THEN "≡E"(1)]; (AOT_subst_intro_helper+)?)
2452
2453method AOT_subst_using uses subst =
2454    (match subst in "[?w  ψ  χ]" for ψ χ  2455       match conclusion in "[v  «φ ψ»]" for φ v 2456         rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(2)]
2457         ; ((AOT_subst_intro_helper | (fact subst; fail))+)?››)
2458
2459method AOT_subst_using_rev uses subst =
2460    (match subst in "[?w  ψ  χ]" for ψ χ  2461      match conclusion in "[v  «φ χ»]" for φ v 2462        rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(1)]
2463        ; ((AOT_subst_intro_helper | (fact subst; fail))+)?››)
2464
2465AOT_theorem "rule-sub-remark:1[1]": assumes  A!x  ¬E!x and ¬A!x shows ¬¬E!x
2466  by (AOT_subst_rev "«A!x»" "«¬E!x»") (auto simp: assms)
2467
2468AOT_theorem "rule-sub-remark:1[2]": assumes  A!x  ¬E!x and  ¬¬E!x shows ¬A!x
2469  by (AOT_subst "«A!x»" "«¬E!x»") (auto simp: assms)
2470
2471AOT_theorem "rule-sub-remark:2[1]":
2472  assumes  [R]xy  ([R]xy & ([Q]a  ¬[Q]a)) and p  [R]xy shows p  [R]xy & ([Q]a  ¬[Q]a)
2473  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2474
2475AOT_theorem "rule-sub-remark:2[2]":
2476  assumes  [R]xy  ([R]xy & ([Q]a  ¬[Q]a)) and p  [R]xy & ([Q]a  ¬[Q]a) shows p  [R]xy
2477  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2478
2479AOT_theorem "rule-sub-remark:3[1]":
2480  assumes for arbitrary x:  A!x  ¬E!x
2481      and x A!x
2482    shows x ¬E!x
2483  by (AOT_subst_rev "λκ. «A!κ»" "λκ. «¬E!κ»") (auto simp: assms)
2484
2485AOT_theorem "rule-sub-remark:3[2]":
2486  assumes for arbitrary x:  A!x  ¬E!x
2487      and x ¬E!x
2488    shows x A!x
2489  by (AOT_subst "λκ. «A!κ»" "λκ. «¬E!κ»") (auto simp: assms)
2490
2491AOT_theorem "rule-sub-remark:4[1]":
2492  assumes  ¬¬[P]x  [P]x and 𝒜¬¬[P]x shows 𝒜[P]x
2493  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2494
2495AOT_theorem "rule-sub-remark:4[2]":
2496  assumes  ¬¬[P]x  [P]x and 𝒜[P]x shows 𝒜¬¬[P]x
2497  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2498
2499AOT_theorem "rule-sub-remark:5[1]":
2500  assumes  (φ  ψ)  (¬ψ  ¬φ) and (φ  ψ) shows (¬ψ  ¬φ)
2501  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2502
2503AOT_theorem "rule-sub-remark:5[2]":
2504  assumes  (φ  ψ)  (¬ψ  ¬φ) and (¬ψ  ¬φ) shows (φ  ψ) 
2505  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2506
2507AOT_theorem "rule-sub-remark:6[1]":
2508  assumes  ψ  χ and (φ  ψ) shows (φ  χ) 
2509  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2510
2511AOT_theorem "rule-sub-remark:6[2]":
2512  assumes  ψ  χ and (φ  χ) shows (φ  ψ)
2513  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2514
2515AOT_theorem "rule-sub-remark:7[1]":
2516  assumes  φ  ¬¬φ and (φ  φ) shows (¬¬φ  φ) 
2517  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2518
2519AOT_theorem "rule-sub-remark:7[2]":
2520  assumes  φ  ¬¬φ and (¬¬φ  φ) shows  (φ  φ)
2521  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2522
2523AOT_theorem "KBasic2:1": ¬φ  ¬φ
2524  by (meson "conventions:5" "contraposition:2" "Hypothetical Syllogism" "df-rules-formulas[3]"
2525            "df-rules-formulas[4]" "≡I" "useful-tautologies:1")
2526
2527AOT_theorem "KBasic2:2": (φ  ψ)  (φ  ψ)
2528proof -
2529  AOT_have (φ  ψ)  ¬(¬φ & ¬ψ)
2530    by (simp add: "RE◇" "oth-class-taut:5:b")
2531  also AOT_have   ¬(¬φ & ¬ψ)
2532    using "KBasic:11" "≡E"(6) "oth-class-taut:3:a" by blast
2533  also AOT_have   ¬(¬φ & ¬ψ)
2534    using "KBasic:3" "≡E"(1) "oth-class-taut:4:b" by blast
2535  also AOT_have   ¬(¬φ & ¬ψ)
2536    apply (AOT_subst_rev "«¬φ»" "«¬φ»")
2537    apply (simp add: "KBasic2:1")
2538    apply (AOT_subst_rev "«¬ψ»" "«¬ψ»")
2539    by (auto simp: "KBasic2:1" "oth-class-taut:3:a")
2540  also AOT_have   ¬¬(φ  ψ)
2541    using "≡E"(6) "oth-class-taut:3:b" "oth-class-taut:5:b" by blast
2542  also AOT_have   φ  ψ
2543    by (simp add: "≡I" "useful-tautologies:1" "useful-tautologies:2")
2544  finally show ?thesis .
2545qed
2546
2547AOT_theorem "KBasic2:3": (φ & ψ)  (φ & ψ)
2548  by (metis "RM◇" "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "deduction-theorem" "modus-tollens:1" "reductio-aa:1")
2549
2550AOT_theorem "KBasic2:4": (φ  ψ)  (φ  ψ)
2551proof -
2552  AOT_have (φ  ψ)  (¬φ  ψ)
2553    by (AOT_subst "«φ  ψ»" "«¬φ  ψ»")
2554       (auto simp: "oth-class-taut:1:c" "oth-class-taut:3:a")
2555  also AOT_have ...  ¬φ  ψ
2556    by (simp add: "KBasic2:2")
2557  also AOT_have ...  ¬φ  ψ
2558    by (AOT_subst "«¬φ»" "«¬φ»")
2559       (auto simp: "KBasic:11" "oth-class-taut:3:a")
2560  also AOT_have ...  φ  ψ
2561    using "≡E"(6) "oth-class-taut:1:c" "oth-class-taut:3:a" by blast
2562  finally show ?thesis .
2563qed
2564
2565AOT_theorem "KBasic2:5": φ  ¬¬φ
2566  apply (AOT_subst "«φ»" "«¬¬φ»")
2567   apply (simp add: "conventions:5" "≡Df")
2568  apply (AOT_subst "«¬¬φ»" "«¬¬¬¬φ»")
2569   apply (simp add: "conventions:5" "≡Df")
2570  apply (AOT_subst_rev "«¬φ»"  "«¬¬¬φ»")
2571   apply (simp add: "oth-class-taut:3:b")
2572  by (simp add: "oth-class-taut:3:a")
2573
2574
2575AOT_theorem "KBasic2:6": (φ  ψ)  (φ  ψ)
2576proof(rule "→I"; rule "raa-cor:1")
2577  AOT_assume (φ  ψ)
2578  AOT_hence (¬φ  ψ)
2579    apply - apply (AOT_subst_rev "«φ  ψ»" "«¬φ  ψ»")
2580    by (simp add: "conventions:2" "≡Df")
2581  AOT_hence 1: ¬φ  ψ using "KBasic:13" "vdash-properties:10" by blast
2582  AOT_assume ¬(φ  ψ)
2583  AOT_hence ¬φ and ¬ψ using "&E" "≡E"(1) "oth-class-taut:5:d" by blast+
2584  AOT_thus ψ & ¬ψ using "&I"(1) 1[THEN "→E"] "KBasic:11" "≡E"(4) "raa-cor:3" by blast
2585qed
2586
2587AOT_theorem "KBasic2:7": ((φ  ψ) & ¬φ)  ψ
2588proof(rule "→I"; frule "&E"(1); drule "&E"(2))
2589  AOT_assume (φ  ψ)
2590  AOT_hence 1: φ  ψ
2591    using "KBasic2:6" "∨I"(2) "∨E"(1) by blast
2592  AOT_assume ¬φ
2593  AOT_hence ¬φ using "KBasic:11" "≡E"(2) by blast
2594  AOT_thus ψ using 1 "∨E"(2) by blast
2595qed
2596
2597AOT_theorem "T-S5-fund:1": φ  φ
2598  by (meson "≡dfI" "conventions:5" "contraposition:2" "Hypothetical Syllogism" "deduction-theorem" "qml:2"[axiom_inst])
2599lemmas "T◇" = "T-S5-fund:1"
2600
2601AOT_theorem "T-S5-fund:2": φ  φ
2602proof(rule "→I")
2603  AOT_assume φ
2604  AOT_hence ¬¬φ
2605    using "KBasic:14" "≡E"(4) "raa-cor:3" by blast
2606  moreover AOT_have ¬φ  ¬φ
2607    by (fact "qml:3"[axiom_inst])
2608  ultimately AOT_have ¬¬φ
2609    using "modus-tollens:1" by blast
2610  AOT_thus φ using "KBasic:12" "≡E"(2) by blast
2611qed
2612lemmas "5◇" = "T-S5-fund:2"
2613
2614(* Also interestingly none of these have proofs in PLM. *)
2615AOT_theorem "Act-Sub:1": 𝒜φ  ¬𝒜¬φ
2616  by (AOT_subst "«𝒜¬φ»" "«¬𝒜φ»")
2617     (auto simp: "logic-actual-nec:1"[axiom_inst] "oth-class-taut:3:b")
2618
2619AOT_theorem "Act-Sub:2": φ  𝒜φ
2620  apply (AOT_subst "«φ»" "«¬¬φ»")
2621   apply (simp add: "conventions:5" "≡Df")
2622  by (metis "deduction-theorem" "≡I" "≡E"(1) "≡E"(2) "≡E"(3)
2623            "logic-actual-nec:1"[axiom_inst] "qml-act:2"[axiom_inst])
2624
2625AOT_theorem "Act-Sub:3": 𝒜φ  φ
2626  apply (AOT_subst "«φ»" "«¬¬φ»")
2627   apply (simp add: "conventions:5" "≡Df")
2628  by (metis "Act-Sub:1" "deduction-theorem" "≡E"(4) "nec-imp-act" "reductio-aa:2" "vdash-properties:6")
2629
2630
2631AOT_theorem "Act-Sub:4": 𝒜φ  𝒜φ
2632proof (rule "≡I"; rule "→I")
2633  AOT_assume 𝒜φ
2634  AOT_thus 𝒜φ using "T◇" "vdash-properties:10" by blast
2635next
2636  AOT_assume 𝒜φ
2637  AOT_hence ¬¬𝒜φ
2638    using "≡dfE" "conventions:5" by blast
2639  AOT_hence ¬𝒜¬φ
2640    apply - apply (AOT_subst "«𝒜¬φ»" "«¬𝒜φ»")
2641    by (simp add: "logic-actual-nec:1"[axiom_inst])
2642  AOT_thus 𝒜φ
2643      using "Act-Basic:1" "Act-Basic:6" "∨E"(3) "≡E"(4) "reductio-aa:1" by blast
2644qed
2645
2646AOT_theorem "Act-Sub:5": 𝒜φ  𝒜φ
2647  by (metis "Act-Sub:2" "Act-Sub:3" "Act-Sub:4" "deduction-theorem" "≡E"(1) "≡E"(2) "vdash-properties:6")
2648
2649AOT_theorem "S5Basic:1": φ  φ
2650  by (simp add: "≡I" "qml:2" "qml:3" "vdash-properties:1[2]")
2651
2652AOT_theorem "S5Basic:2": φ  φ
2653  by (simp add: "T◇" "5◇" "≡I")
2654
2655AOT_theorem "S5Basic:3": φ  φ
2656  using "T◇" "Hypothetical Syllogism" "qml:3" "vdash-properties:1[2]" by blast
2657lemmas "B" = "S5Basic:3"
2658
2659AOT_theorem "S5Basic:4": φ  φ
2660  using "5◇" "Hypothetical Syllogism" "qml:2" "vdash-properties:1[2]" by blast
2661lemmas "B◇" = "S5Basic:4"
2662
2663AOT_theorem "S5Basic:5": φ  φ
2664  using "RM:1" "B" "5◇" "Hypothetical Syllogism" by blast
2665lemmas "4" = "S5Basic:5"
2666
2667AOT_theorem "S5Basic:6": φ  φ
2668  by (simp add: "4" "≡I" "qml:2"[axiom_inst])
2669
2670AOT_theorem "S5Basic:7": φ  φ
2671  apply (AOT_subst "«φ»" "«¬¬φ»")
2672   apply (simp add: "conventions:5" "≡Df")
2673  apply (AOT_subst "«φ»" "«¬¬φ»")
2674   apply (simp add: "conventions:5" "≡Df")
2675  apply (AOT_subst_rev "«¬φ»" "«¬¬¬φ»")
2676   apply (simp add: "oth-class-taut:3:b")
2677  apply (AOT_subst_rev "«¬φ»" "«¬φ»")
2678   apply (simp add: "S5Basic:6")
2679  by (simp add: "if-p-then-p")
2680
2681lemmas "4◇" = "S5Basic:7"
2682
2683AOT_theorem "S5Basic:8": φ  φ
2684  by (simp add: "4◇" "T◇" "≡I")
2685
2686AOT_theorem "S5Basic:9": (φ  ψ)  (φ  ψ)
2687  apply (rule "≡I"; rule "→I")
2688  using "KBasic2:6" "5◇" "∨I"(3) "if-p-then-p" "vdash-properties:10" apply blast
2689  by (meson "KBasic:15" "4" "∨I"(3) "∨E"(1) "Disjunction Addition"(1) "con-dis-taut:7"
2690            "intro-elim:1" "Commutativity of ∨")
2691
2692AOT_theorem "S5Basic:10": (φ  ψ)  (φ  ψ)
2693(* Note: nicely this proof is entirely sledgehammer generated *)
2694proof(rule "≡I"; rule "→I")
2695  AOT_assume (φ  ψ)
2696  AOT_hence φ  ψ
2697    by (meson "KBasic2:6" "∨I"(2) "∨E"(1))
2698  AOT_thus φ  ψ
2699    by (meson "B◇" "4" "4◇" "T◇" "∨I"(3))
2700next
2701  AOT_assume φ  ψ
2702  AOT_hence φ  ψ
2703    by (meson "S5Basic:1" "B◇" "S5Basic:6" "T◇" "5◇" "∨I"(3) "intro-elim:1")
2704  AOT_thus (φ  ψ)
2705    by (meson "KBasic:15" "∨I"(3) "∨E"(1) "Disjunction Addition"(1) "Disjunction Addition"(2))
2706qed
2707
2708AOT_theorem "S5Basic:11": (φ & ψ)  (φ & ψ)
2709proof -
2710  AOT_have (φ & ψ)  ¬(¬φ  ¬ψ)
2711    by (AOT_subst "«φ & ψ»" "«¬(¬φ  ¬ψ)»")
2712       (auto simp: "oth-class-taut:5:a" "oth-class-taut:3:a")
2713  also AOT_have   ¬(¬φ  ¬ψ)
2714    by (AOT_subst "«¬ψ»" "«¬ψ»")
2715       (auto simp: "KBasic2:1" "oth-class-taut:3:a")
2716  also AOT_have   ¬(¬φ  ¬ψ)
2717    using "KBasic:11" "≡E"(6) "oth-class-taut:3:a" by blast
2718  also AOT_have   ¬(¬φ  ¬ψ)
2719    using "S5Basic:9" "≡E"(1) "oth-class-taut:4:b" by blast
2720  also AOT_have   ¬(¬φ  ¬ψ)
2721    apply (AOT_subst "«¬φ»" "«¬φ»")
2722     apply (simp add: "KBasic2:1")
2723    apply (AOT_subst "«¬ψ»" "«¬ψ»")
2724    by (auto simp: "KBasic2:1" "oth-class-taut:3:a")
2725  also AOT_have   φ & ψ
2726    using "≡E"(6) "oth-class-taut:3:a" "oth-class-taut:5:a" by blast
2727  finally show ?thesis .
2728qed
2729
2730AOT_theorem "S5Basic:12": (φ & ψ)  (φ & ψ)
2731proof (rule "≡I"; rule "→I")
2732  AOT_assume (φ & ψ)
2733  AOT_hence φ & ψ
2734    using "KBasic2:3" "vdash-properties:6" by blast
2735  AOT_thus φ & ψ
2736    using "5◇" "&I" "&E"(1) "&E"(2) "vdash-properties:6" by blast
2737next
2738  AOT_assume φ & ψ
2739  moreover AOT_have (ψ & φ)  (φ & ψ)
2740    by (AOT_subst "«φ & ψ»" "«ψ & φ»")
2741       (auto simp: "Commutativity of &" "KBasic:16")
2742  ultimately AOT_show (φ & ψ)
2743    by (metis "4" "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "vdash-properties:6")
2744qed
2745
2746
2747AOT_theorem "S5Basic:13": (φ  ψ)  (φ  ψ)
2748proof (rule "≡I")
2749  AOT_modally_strict {
2750    AOT_have (φ  ψ)  (φ  ψ)
2751      by (meson "KBasic:13" "B◇" "Hypothetical Syllogism" "deduction-theorem")
2752  }
2753  AOT_hence (φ  ψ)  (φ  ψ)
2754    by (rule RM)
2755  AOT_thus  (φ  ψ)  (φ  ψ)
2756    using "4" "Hypothetical Syllogism" by blast
2757next
2758  AOT_modally_strict {
2759    AOT_have (φ  ψ)  (φ  ψ)
2760      by (meson "B" "Hypothetical Syllogism" "deduction-theorem" "qml:1" "vdash-properties:1[2]")
2761  }
2762  AOT_hence  (φ  ψ)  (φ  ψ)
2763    by (rule RM)
2764  AOT_thus (φ  ψ)  (φ  ψ)
2765    using "4" "Hypothetical Syllogism" by blast
2766qed
2767
2768AOT_theorem "derived-S5-rules:1":
2769  assumes Γ  φ  ψ shows Γ  φ  ψ
2770proof -
2771  AOT_have Γ  φ  ψ
2772    using assms by (rule "RM:1[prem]")
2773  AOT_thus Γ  φ  ψ
2774    using "B" "Hypothetical Syllogism" by blast
2775qed
2776
2777AOT_theorem "derived-S5-rules:2":
2778  assumes Γ  φ  ψ shows Γ  φ  ψ
2779proof -
2780  AOT_have Γ  φ  ψ
2781    using assms by (rule "RM:2[prem]")
2782  AOT_thus Γ  φ  ψ
2783    using "B◇" "Hypothetical Syllogism" by blast
2784qed
2785
2786AOT_theorem "BFs:1": α φ{α}  α φ{α}
2787proof -
2788  AOT_modally_strict {
2789    AOT_modally_strict {
2790      AOT_have α φ{α}  φ{α} for α by (fact AOT)
2791    }
2792    AOT_hence α φ{α}  φ{α} for α by (rule "RM◇")
2793    AOT_hence α φ{α}  α φ{α}
2794      using "B◇" "∀I" "→E" "→I" by metis
2795  }
2796  thus ?thesis using "derived-S5-rules:1" by blast
2797qed
2798lemmas "BF" = "BFs:1"
2799
2800AOT_theorem "BFs:2": α φ{α}  α φ{α}
2801proof -
2802  AOT_have α φ{α}  φ{α} for α using RM "cqt-orig:3" by metis
2803  thus ?thesis using  "cqt-orig:2"[THEN "→E"] "∀I" by metis
2804qed
2805lemmas "CBF" = "BFs:2"
2806
2807AOT_theorem "BFs:3": α φ{α}  α φ{α}
2808proof(rule "→I")
2809  AOT_modally_strict {
2810    AOT_have α ¬φ{α}  α ¬φ{α}
2811      using BF CBF "≡I" by blast
2812  } note θ = this
2813
2814  AOT_assume α φ{α}
2815  AOT_hence ¬¬(α φ{α})
2816    using "≡dfE" "conventions:5" by blast
2817  AOT_hence ¬α ¬φ{α}
2818    apply - apply (AOT_subst "«α ¬φ{α}»" "«¬(α φ{α})»")
2819    using "≡dfI" "conventions:3" "conventions:4" "&I" "contraposition:2" "cqt-further:4"
2820          "df-rules-formulas[1]" "vdash-properties:1[2]" by blast
2821  AOT_hence ¬α ¬φ{α}
2822    apply - apply (AOT_subst_using_rev subst: θ)
2823    using θ by blast
2824  AOT_hence ¬α ¬¬¬φ{α}
2825    apply - apply (AOT_subst_rev "λ τ. «¬φ{τ}»"  "λ τ. «¬¬¬φ{τ}»")
2826    by (simp add: "oth-class-taut:3:b")
2827  AOT_hence 0: α ¬¬φ{α}
2828    by (rule "conventions:4"[THEN "≡dfI"])
2829  AOT_show α φ{α}
2830    apply (AOT_subst "λ τ . «φ{τ}»" "λ τ . «¬¬φ{τ}»")
2831     apply (simp add: "conventions:5" "≡Df")
2832    using 0 by blast
2833qed
2834lemmas "BF◇" = "BFs:3"
2835
2836AOT_theorem "BFs:4": α φ{α}  α φ{α}
2837proof(rule "→I")
2838  AOT_assume α φ{α}
2839  AOT_hence ¬α ¬φ{α}
2840    using "conventions:4"[THEN "≡dfE"] by blast
2841  AOT_hence ¬α ¬φ{α}
2842    apply - apply (AOT_subst "λ τ . «¬φ{τ}»" "λ τ . «¬φ{τ}»")
2843    by (simp add: "KBasic2:1")
2844  moreover AOT_have α ¬φ{α}  α ¬φ{α}
2845    using "≡I" "BF" "CBF" by metis
2846  ultimately AOT_have 1: ¬α ¬φ{α}
2847    using "≡E"(3) by blast
2848  AOT_show α φ{α}
2849    apply (rule "conventions:5"[THEN "≡dfI"])
2850    apply (AOT_subst "«α φ{α}»" "«¬α ¬φ{α}»")
2851     apply (simp add: "conventions:4" "≡Df")
2852    apply (AOT_subst "«¬¬α ¬φ{α}»" "«α ¬φ{α}»")
2853    by (auto simp: 1 "≡I" "useful-tautologies:1" "useful-tautologies:2")
2854qed
2855lemmas "CBF◇" = "BFs:4"
2856
2857AOT_theorem "sign-S5-thm:1": α φ{α}  α φ{α}
2858proof(rule "→I")
2859  AOT_assume α φ{α}
2860  then AOT_obtain α where φ{α} using "∃E" by metis
2861  moreover AOT_have α
2862    by (simp add: "ex:1:a" "rule-ui:2[const_var]" RN)
2863  moreover AOT_have φ{τ}, τ  α φ{α} for τ
2864  proof -
2865    AOT_have φ{τ}, τ  α φ{α} using "existential:1" by blast
2866    AOT_thus φ{τ}, τ  α φ{α}
2867      using "RN[prem]"[where Γ="{φ τ, «τ»}", simplified] by blast
2868  qed
2869  ultimately AOT_show α φ{α} by blast
2870qed
2871lemmas Buridan = "sign-S5-thm:1"
2872
2873AOT_theorem "sign-S5-thm:2": α φ{α}  α φ{α}
2874proof -
2875  AOT_have α (α φ{α}  φ{α})
2876    by (simp add: "RM◇" "cqt-orig:3" "∀I")
2877  AOT_thus α φ{α}  α φ{α}
2878    using "∀E"(4) "∀I" "→E" "→I" by metis
2879qed
2880lemmas "Buridan◇" = "sign-S5-thm:2"
2881
2882AOT_theorem "sign-S5-thm:3": α (φ{α} & ψ{α})  (α φ{α} & α ψ{α})
2883  apply (rule "RM:2")
2884  by (metis (no_types, lifting) "instantiation" "&I" "&E"(1)
2885                                "&E"(2) "deduction-theorem" "existential:2[const_var]")
2886
2887AOT_theorem "sign-S5-thm:4": α (φ{α} & ψ{α})  α φ{α}
2888  apply (rule "RM:2")
2889  by (meson "instantiation" "&E"(1) "deduction-theorem" "existential:2[const_var]")
2890
2891AOT_theorem "sign-S5-thm:5": (α (φ{α}  ψ{α}) & α (ψ{α}  χ{α}))  α (φ{α}  χ{α})
2892proof -
2893  {
2894    fix φ' ψ' χ'
2895    AOT_assume  φ' & ψ'  χ'
2896    AOT_hence φ' & ψ'  χ'
2897      using "RN[prem]"[where Γ="{φ', ψ'}"] apply simp
2898      using "&E" "&I" "→E" "→I" by metis
2899  } note R = this
2900  show ?thesis by (rule R; fact AOT)
2901qed
2902
2903AOT_theorem "sign-S5-thm:6": (α (φ{α}  ψ{α}) & α(ψ{α}  χ{α}))  α(φ{α}  χ{α})
2904proof -
2905  {
2906    fix φ' ψ' χ'
2907    AOT_assume  φ' & ψ'  χ'
2908    AOT_hence φ' & ψ'  χ'
2909      using "RN[prem]"[where Γ="{φ', ψ'}"] apply simp
2910      using "&E" "&I" "→E" "→I" by metis
2911  } note R = this
2912  show ?thesis by (rule R; fact AOT)
2913qed
2914
2915AOT_theorem "exist-nec2:1": τ  τ
2916  using "B◇" "RM◇" "Hypothetical Syllogism" "exist-nec" by blast
2917
2918AOT_theorem "exists-nec2:2": τ  τ
2919  by (meson "Act-Sub:3" "Hypothetical Syllogism" "exist-nec" "exist-nec2:1" "≡I" "nec-imp-act")
2920
2921AOT_theorem "exists-nec2:3": ¬τ  ¬τ
2922  using "KBasic2:1" "deduction-theorem" "exist-nec2:1" "≡E"(2) "modus-tollens:1" by blast
2923
2924AOT_theorem "exists-nec2:4": ¬τ  ¬τ
2925  by (metis "Act-Sub:3" "KBasic:12" "deduction-theorem" "exist-nec" "exists-nec2:3" "≡I" "≡E"(4) "nec-imp-act" "reductio-aa:1")
2926
2927AOT_theorem "id-nec2:1": α = β  α = β
2928  using "B◇" "RM◇" "Hypothetical Syllogism" "id-nec:1" by blast
2929
2930AOT_theorem "id-nec2:2": α  β  α  β
2931  apply (AOT_subst_using subst: "=-infix"[THEN "≡Df"])
2932  using "KBasic2:1" "deduction-theorem" "id-nec2:1" "≡E"(2) "modus-tollens:1" by blast
2933
2934AOT_theorem "id-nec2:3": α  β  α  β
2935  apply (AOT_subst_using subst: "=-infix"[THEN "≡Df"])
2936  by (metis "KBasic:11" "deduction-theorem" "id-nec:2" "≡E"(3) "reductio-aa:2" "vdash-properties:6")
2937
2938AOT_theorem "id-nec2:4": α = β  α = β
2939  using "Hypothetical Syllogism" "id-nec2:1" "id-nec:1" by blast
2940
2941AOT_theorem "id-nec2:5": α  β  α  β
2942  using "id-nec2:3" "id-nec2:2" "→I" "→E" by metis
2943
2944AOT_theorem "sc-eq-box-box:1": (φ  φ)  (φ  φ)
2945  apply (rule "≡I"; rule "→I")
2946  using "KBasic:13" "5◇" "Hypothetical Syllogism" "vdash-properties:10" apply blast
2947  by (metis "KBasic2:1" "KBasic:1" "KBasic:2" "S5Basic:13" "≡E"(2) "raa-cor:5" "vdash-properties:6")
2948
2949AOT_theorem "sc-eq-box-box:2": ((φ  φ)  (φ  φ))  (φ  φ)
2950  by (metis "Act-Sub:3" "KBasic:13" "5◇" "∨E"(2) "deduction-theorem" "≡I" "nec-imp-act" "raa-cor:2" "vdash-properties:10")
2951
2952AOT_theorem "sc-eq-box-box:3": (φ  φ)  (¬φ  ¬φ)
2953proof (rule "→I"; rule "≡I"; rule "→I")
2954  AOT_assume (φ  φ)
2955  AOT_hence φ  φ using "sc-eq-box-box:1" "≡E" by blast
2956  moreover AOT_assume ¬φ
2957  ultimately AOT_have ¬φ
2958    using "modus-tollens:1" by blast
2959  AOT_thus ¬φ
2960    using "KBasic2:1" "≡E"(2) by blast
2961next
2962  AOT_assume (φ  φ)
2963  moreover AOT_assume ¬φ
2964  ultimately AOT_show ¬φ
2965    using "modus-tollens:1" "qml:2" "vdash-properties:10" "vdash-properties:1[2]" by blast
2966qed
2967
2968AOT_theorem "sc-eq-box-box:4": ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
2969proof(rule "→I"; rule "→I")
2970  AOT_assume θ: (φ  φ) & (ψ  ψ)
2971  AOT_assume ξ: φ  ψ
2972  AOT_hence (φ & ψ)  (¬φ & ¬ψ)
2973    using "≡E"(4) "oth-class-taut:4:g" "raa-cor:3" by blast
2974  moreover {
2975    AOT_assume φ & ψ
2976    AOT_hence (φ  ψ)
2977      using "KBasic:3" "KBasic:8" "≡E"(2) "vdash-properties:10" by blast
2978  }
2979  moreover {
2980    AOT_assume ¬φ & ¬ψ
2981    moreover AOT_have ¬φ  ¬φ and ¬ψ  ¬ψ
2982      using θ "Conjunction Simplification"(1) "Conjunction Simplification"(2) "sc-eq-box-box:3" "vdash-properties:10" by metis+
2983    ultimately AOT_have ¬φ & ¬ψ
2984      by (metis "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "≡E"(4) "modus-tollens:1" "raa-cor:3")
2985    AOT_hence (φ  ψ)
2986      using "KBasic:3" "KBasic:9" "≡E"(2) "vdash-properties:10" by blast
2987  }
2988  ultimately AOT_show (φ  ψ)
2989    using "∨E"(2) "reductio-aa:1" by blast
2990qed
2991
2992AOT_theorem "sc-eq-box-box:5": ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
2993proof (rule "→I"; rule "→I")
2994  AOT_assume A: ((φ  φ) & (ψ  ψ))
2995  AOT_hence φ  φ and ψ  ψ
2996    using "&E" "qml:2"[axiom_inst] "→E" by blast+
2997  moreover AOT_assume φ  ψ
2998  ultimately AOT_have φ  ψ
2999    using "→E" "qml:2"[axiom_inst] "≡E" "≡I" by meson
3000  moreover AOT_have (φ  ψ)  (φ  ψ)
3001    using A "sc-eq-box-box:4" "→E" by blast
3002  ultimately AOT_show (φ  ψ) using "→E" by blast
3003qed
3004
3005AOT_theorem "sc-eq-box-box:6": (φ  φ)  ((φ  ψ)  (φ  ψ))
3006proof (rule "→I"; rule "→I"; rule "raa-cor:1")
3007  AOT_assume ¬(φ  ψ)
3008  AOT_hence 1: ¬(φ  ψ) by (metis "KBasic:11" "≡E"(1))
3009  AOT_have (φ & ¬ψ)
3010    apply (AOT_subst «φ & ¬ψ» «¬(φ  ψ)»)
3011     apply (meson "Commutativity of ≡" "≡E"(1) "oth-class-taut:1:b")
3012    by (fact 1)
3013  AOT_hence φ and 2: ¬ψ using "KBasic2:3"[THEN "→E"] "&E" by blast+
3014  moreover AOT_assume (φ  φ)
3015  ultimately AOT_have φ by (metis "≡E"(1) "sc-eq-box-box:1" "→E")
3016  AOT_hence φ using "qml:2"[axiom_inst, THEN "→E"] by blast
3017  moreover AOT_assume φ  ψ
3018  ultimately AOT_have ψ using "→E" by blast
3019  moreover AOT_have ¬ψ using 2 "KBasic:12" "¬¬I" "intro-elim:3:d" by blast
3020  ultimately AOT_show ψ & ¬ψ using "&I" by blast
3021qed
3022
3023AOT_theorem "sc-eq-box-box:7": (φ  φ)  ((φ  𝒜ψ)  𝒜(φ  ψ))
3024proof (rule "→I"; rule "→I"; rule "raa-cor:1")
3025  AOT_assume ¬𝒜(φ  ψ)
3026  AOT_hence 1: 𝒜¬(φ  ψ) by (metis "Act-Basic:1" "∨E"(2))
3027  AOT_have 𝒜(φ & ¬ψ)
3028    apply (AOT_subst «φ & ¬ψ» «¬(φ  ψ)»)
3029     apply (meson "Commutativity of ≡" "≡E"(1) "oth-class-taut:1:b")
3030    by (fact 1)
3031  AOT_hence 𝒜φ and 2: 𝒜¬ψ using "Act-Basic:2"[THEN "≡E"(1)] "&E" by blast+
3032  AOT_hence φ by (metis "Act-Sub:3" "→E")
3033  moreover AOT_assume (φ  φ)
3034  ultimately AOT_have φ by (metis "≡E"(1) "sc-eq-box-box:1" "→E")
3035  AOT_hence φ using "qml:2"[axiom_inst, THEN "→E"] by blast
3036  moreover AOT_assume φ  𝒜ψ
3037  ultimately AOT_have 𝒜ψ using "→E" by blast
3038  moreover AOT_have ¬𝒜ψ using 2 by (meson "Act-Sub:1" "≡E"(4) "raa-cor:3")
3039  ultimately AOT_show 𝒜ψ & ¬𝒜ψ using "&I" by blast
3040qed
3041
3042AOT_theorem "sc-eq-fur:1": 𝒜φ  𝒜φ
3043  using "Act-Basic:6" "Act-Sub:4" "≡E"(6) by blast
3044
3045AOT_theorem "sc-eq-fur:2": (φ  φ)  (𝒜φ  φ)
3046  by (metis "B◇" "Act-Sub:3" "KBasic:13" "T◇" "Hypothetical Syllogism" "deduction-theorem" "≡I" "nec-imp-act")
3047
3048AOT_theorem "sc-eq-fur:3": x (φ{x}  φ{x})  (∃!x φ{x}  ιx φ{x})
3049proof (rule "→I"; rule "→I")
3050  AOT_assume x (φ{x}  φ{x})
3051  AOT_hence A: x (φ{x}  φ{x}) using CBF "→E" by blast
3052  AOT_assume ∃!x φ{x}
3053  then AOT_obtain a where a_def: φ{a} & y (φ{y}  y = a)
3054    using "∃E"[rotated 1, OF "uniqueness:1"[THEN "≡dfE"]] by blast
3055  moreover AOT_have φ{a} using calculation A "∀E"(2) "qml:2"[axiom_inst] "→E" "&E"(1) by blast
3056  AOT_hence 𝒜φ{a} using "nec-imp-act" "vdash-properties:6" by blast
3057  moreover AOT_have y (𝒜φ{y}  y = a)
3058  proof (rule "∀I"; rule "→I")
3059    fix b
3060    AOT_assume 𝒜φ{b}
3061    AOT_hence φ{b}
3062      using "Act-Sub:3" "vdash-properties:6" by blast
3063    moreover {
3064      AOT_have (φ{b}  φ{b})
3065        using A "∀E"(2) by blast
3066      AOT_hence φ{b}  φ{b}
3067        using "KBasic:13" "5◇" "Hypothetical Syllogism" "vdash-properties:6" by blast
3068    }
3069    ultimately AOT_have φ{b} using "→E" by blast
3070    AOT_hence φ{b} using "qml:2"[axiom_inst] "→E" by blast
3071    AOT_thus b = a
3072      using a_def[THEN "&E"(2)] "∀E"(2) "→E" by blast
3073  qed
3074  ultimately AOT_have 𝒜φ{a} & y (𝒜φ{y}  y = a)
3075    using "&I" by blast
3076  AOT_hence x (𝒜φ{x} & y (𝒜φ{y}  y = x)) using "∃I" by fast
3077  AOT_hence ∃!x 𝒜φ{x} using "uniqueness:1"[THEN "≡dfI"] by fast
3078  AOT_thus ιx φ{x}
3079    using "actual-desc:1"[THEN "≡E"(2)] by blast
3080qed
3081
3082AOT_theorem "sc-eq-fur:4": x (φ{x}  φ{x})  (x = ιx φ{x}  (φ{x} & z (φ{z}  z = x)))
3083proof (rule "→I")
3084  AOT_assume x (φ{x}  φ{x})
3085  AOT_hence x (φ{x}  φ{x}) using CBF "→E" by blast
3086  AOT_hence A: 𝒜φ{α}  φ{α} for α using "sc-eq-fur:2" "∀E" "→E" by fast
3087  AOT_show x = ιx φ{x}  (φ{x} & z (φ{z}  z = x))
3088  proof (rule "≡I"; rule "→I")
3089    AOT_assume x = ιx φ{x}
3090    AOT_hence B: 𝒜φ{x} & z (𝒜φ{z}  z = x)
3091      using "nec-hintikka-scheme"[THEN "≡E"(1)] by blast
3092    AOT_show φ{x} & z (φ{z}  z = x)
3093    proof (rule "&I"; (rule "∀I"; rule "→I")?)
3094      AOT_show φ{x} using A B[THEN "&E"(1)] "≡E"(1) by blast
3095    next
3096      AOT_show z = x if φ{z} for z
3097        using that B[THEN "&E"(2)] "∀E"(2) "→E" A[THEN "≡E"(2)] by blast
3098    qed
3099  next
3100    AOT_assume B: φ{x} & z (φ{z}  z = x)
3101    AOT_have 𝒜φ{x} & z (𝒜φ{z}  z = x)
3102    proof(rule "&I"; (rule "∀I"; rule "→I")?)
3103      AOT_show 𝒜φ{x} using B[THEN "&E"(1)] A[THEN "≡E"(2)] by blast
3104    next
3105      AOT_show b = x if 𝒜φ{b} for b
3106        using that A[THEN "≡E"(1)] B[THEN "&E"(2), THEN "∀E"(2), THEN "→E"] by blast
3107    qed
3108    AOT_thus x = ιx φ{x}
3109      using "nec-hintikka-scheme"[THEN "≡E"(2)] by blast
3110  qed
3111qed
3112
3113AOT_theorem "id-act:1": α = β  𝒜α = β
3114  by (meson "Act-Sub:3" "Hypothetical Syllogism" "id-nec2:1" "id-nec:2" "≡I" "nec-imp-act")
3115
3116AOT_theorem "id-act:2": α  β  𝒜α  β
3117proof (AOT_subst "«α  β»" "«¬(α = β)»")
3118  AOT_modally_strict {
3119    AOT_show α  β  ¬(α = β)
3120      by (simp add: "=-infix" "≡Df")
3121  }
3122next
3123  AOT_show ¬(α = β)  𝒜¬(α = β)
3124  proof (safe intro!: "≡I" "→I")
3125    AOT_assume ¬α = β
3126    AOT_hence ¬𝒜α = β using "id-act:1" "≡E"(3) by blast
3127    AOT_thus 𝒜¬α = β
3128      using "¬¬E" "Act-Sub:1" "≡E"(3) by blast
3129  next
3130    AOT_assume 𝒜¬α = β
3131    AOT_hence ¬𝒜α = β
3132      using "¬¬I" "Act-Sub:1" "≡E"(4) by blast
3133    AOT_thus ¬α = β
3134      using "id-act:1" "≡E"(4) by blast
3135  qed
3136qed
3137
3138AOT_theorem "A-Exists:1": 𝒜∃!α φ{α}  ∃!α 𝒜φ{α}
3139proof -
3140  AOT_have 𝒜∃!α φ{α}  𝒜αβ (φ{β}  β = α)
3141    by (AOT_subst_using subst: "uniqueness:2")
3142       (simp add: "oth-class-taut:3:a")
3143  also AOT_have   α 𝒜β (φ{β}  β = α)
3144    by (simp add: "Act-Basic:10")
3145  also AOT_have   αβ 𝒜(φ{β}  β = α)
3146    by (AOT_subst "λ τ . «𝒜β (φ{β}  β = τ)»" "λ τ . «β 𝒜(φ{β}  β = τ)»")
3147       (auto simp: "logic-actual-nec:3" "vdash-properties:1[2]" "oth-class-taut:3:a")
3148  also AOT_have   αβ (𝒜φ{β}  𝒜β = α)
3149    by (AOT_subst_rev "λ τ τ' . «𝒜(φ{τ'}  τ' = τ)»" "λ τ τ'. «𝒜φ{τ'}  𝒜τ' = τ»")
3150       (auto simp: "Act-Basic:5" "cqt-further:7")
3151  also AOT_have   αβ (𝒜φ{β}  β = α)
3152    apply (AOT_subst "λ τ τ' :: 'a . «𝒜τ' = τ»" "λ τ τ'. «τ' = τ»")
3153     apply (meson "id-act:1" "≡E"(6) "oth-class-taut:3:a")
3154    by (simp add: "cqt-further:7")
3155  also AOT_have ...  ∃!α 𝒜φ{α}
3156    using "uniqueness:2" "Commutativity of ≡"[THEN "≡E"(1)] by fast
3157  finally show ?thesis .
3158qed
3159
3160AOT_theorem "A-Exists:2": ιx φ{x}  𝒜∃!x φ{x}
3161  by (AOT_subst_using subst: "A-Exists:1")
3162     (simp add: "actual-desc:1")
3163
3164AOT_theorem "id-act-desc:1": ιx (x = y)
3165proof(rule "existence:1"[THEN "≡dfI"]; rule "∃I")
3166  AOT_show x E!x  E!x]ιx (x = y)
3167  proof (rule "russell-axiom[exe,1].nec-russell-axiom"[THEN "≡E"(2)]; rule "∃I"; (rule "&I")+)
3168    AOT_show 𝒜y = y by (simp add: "RA[2]" "id-eq:1")
3169  next
3170    AOT_show z (𝒜z = y  z = y)
3171      apply (rule "∀I")
3172      using "id-act:1"[THEN "≡E"(2)] "→I" by blast
3173  next
3174    AOT_show x E!x  E!x]y
3175    proof (rule "lambda-predicates:2"[axiom_inst, THEN "→E", THEN "≡E"(2)])
3176      AOT_show x E!x  E!x]
3177        by "cqt:2[lambda]"
3178    next
3179      AOT_show E!y  E!y 
3180        by (simp add: "if-p-then-p")
3181    qed
3182  qed
3183next
3184  AOT_show x E!x  E!x]
3185    by "cqt:2[lambda]"
3186qed
3187
3188AOT_theorem "id-act-desc:2": y = ιx (x = y)
3189  by (rule descriptions[axiom_inst, THEN "≡E"(2)]; rule "∀I"; rule "id-act:1"[symmetric])
3190
3191AOT_theorem "pre-en-eq:1[1]": x1[F]  x1[F]
3192  by (simp add: encoding "vdash-properties:1[2]")
3193
3194AOT_theorem "pre-en-eq:1[2]": x1x2[F]  x1x2[F]
3195proof (rule "→I")
3196  AOT_assume x1x2[F]
3197  AOT_hence x1y [F]yx2] and x2y [F]x1y]
3198    using "nary-encoding[2]"[axiom_inst, THEN "≡E"(1)] "&E" by blast+
3199  moreover AOT_have y [F]yx2] by "cqt:2[lambda]"
3200  moreover AOT_have y [F]x1y] by "cqt:2[lambda]"
3201  ultimately AOT_have x1y [F]yx2] and x2y [F]x1y]
3202    using encoding[axiom_inst, unvarify F] "→E" "&I" by blast+
3203  note A = this
3204  AOT_hence (x1y [F]yx2] & x2y [F]x1y])
3205    using "KBasic:3"[THEN "≡E"(2)] "&I" by blast
3206  AOT_thus x1x2[F]
3207    by (rule "nary-encoding[2]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3208qed
3209
3210AOT_theorem "pre-en-eq:1[3]": x1x2x3[F]  x1x2x3[F]
3211proof (rule "→I")
3212  AOT_assume x1x2x3[F]
3213  AOT_hence x1y [F]yx2x3] and x2y [F]x1yx3] and x3y [F]x1x2y]
3214    using "nary-encoding[3]"[axiom_inst, THEN "≡E"(1)] "&E" by blast+
3215  moreover AOT_have y [F]yx2x3] by "cqt:2[lambda]"
3216  moreover AOT_have y [F]x1yx3] by "cqt:2[lambda]"
3217  moreover AOT_have y [F]x1x2y] by "cqt:2[lambda]"
3218  ultimately AOT_have x1y [F]yx2x3] and x2y [F]x1yx3] and x3y [F]x1x2y]
3219    using encoding[axiom_inst, unvarify F] "→E" by blast+
3220  note A = this
3221  AOT_have B: (x1y [F]yx2x3] & x2y [F]x1yx3] & x3y [F]x1x2y])
3222    by (rule "KBasic:3"[THEN "≡E"(2)] "&I" A)+
3223  AOT_thus x1x2x3[F]
3224    by (rule "nary-encoding[3]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3225qed
3226
3227AOT_theorem "pre-en-eq:1[4]": x1x2x3x4[F]  x1x2x3x4[F]
3228proof (rule "→I")
3229  AOT_assume x1x2x3x4[F]
3230  AOT_hence x1y [F]yx2x3x4] and x2y [F]x1yx3x4] and x3y [F]x1x2yx4] and  x4y [F]x1x2x3y]
3231    using "nary-encoding[4]"[axiom_inst, THEN "≡E"(1)] "&E" by metis+
3232  moreover AOT_have y [F]yx2x3x4] by "cqt:2[lambda]"
3233  moreover AOT_have y [F]x1yx3x4] by "cqt:2[lambda]"
3234  moreover AOT_have y [F]x1x2yx4] by "cqt:2[lambda]"
3235  moreover AOT_have y [F]x1x2x3y] by "cqt:2[lambda]"
3236  ultimately AOT_have x1y [F]yx2x3x4] and x2y [F]x1yx3x4] and x3y [F]x1x2yx4] and x4y [F]x1x2x3y]
3237    using "→E" encoding[axiom_inst, unvarify F] by blast+
3238  note A = this
3239  AOT_have B: (x1y [F]yx2x3x4] & x2y [F]x1yx3x4] & x3y [F]x1x2yx4] & x4y [F]x1x2x3y])
3240    by (rule "KBasic:3"[THEN "≡E"(2)] "&I" A)+
3241  AOT_thus x1x2x3x4[F]
3242    by (rule "nary-encoding[4]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3243qed
3244
3245AOT_theorem "pre-en-eq:2[1]": ¬x1[F]  ¬x1[F]
3246proof (rule "→I"; rule "raa-cor:1")
3247  AOT_assume ¬¬x1[F]
3248  AOT_hence x1[F]
3249    by (rule "conventions:5"[THEN "≡dfI"])
3250  AOT_hence x1[F]
3251    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[1]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3252  moreover AOT_assume ¬x1[F]
3253  ultimately AOT_show x1[F] & ¬x1[F] by (rule "&I")
3254qed
3255AOT_theorem "pre-en-eq:2[2]": ¬x1x2[F]  ¬x1x2[F]
3256proof (rule "→I"; rule "raa-cor:1")
3257  AOT_assume ¬¬x1x2[F]
3258  AOT_hence x1x2[F]
3259    by (rule "conventions:5"[THEN "≡dfI"])
3260  AOT_hence x1x2[F]
3261    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[2]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3262  moreover AOT_assume ¬x1x2[F]
3263  ultimately AOT_show x1x2[F] & ¬x1x2[F] by (rule "&I")
3264qed
3265
3266AOT_theorem "pre-en-eq:2[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3267proof (rule "→I"; rule "raa-cor:1")
3268  AOT_assume ¬¬x1x2x3[F]
3269  AOT_hence x1x2x3[F]
3270    by (rule "conventions:5"[THEN "≡dfI"])
3271  AOT_hence x1x2x3[F]
3272    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[3]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3273  moreover AOT_assume ¬x1x2x3[F]
3274  ultimately AOT_show x1x2x3[F] & ¬x1x2x3[F] by (rule "&I")
3275qed
3276
3277AOT_theorem "pre-en-eq:2[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3278proof (rule "→I"; rule "raa-cor:1")
3279  AOT_assume ¬¬x1x2x3x4[F]
3280  AOT_hence x1x2x3x4[F]
3281    by (rule "conventions:5"[THEN "≡dfI"])
3282  AOT_hence x1x2x3x4[F]
3283    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[4]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3284  moreover AOT_assume ¬x1x2x3x4[F]
3285  ultimately AOT_show x1x2x3x4[F] & ¬x1x2x3x4[F] by (rule "&I")
3286qed
3287
3288AOT_theorem "en-eq:1[1]": x1[F]  x1[F]
3289  using "pre-en-eq:1[1]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by metis
3290AOT_theorem "en-eq:1[2]": x1x2[F]  x1x2[F]
3291  using "pre-en-eq:1[2]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by metis
3292AOT_theorem "en-eq:1[3]": x1x2x3[F]  x1x2x3[F]
3293  using "pre-en-eq:1[3]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by fast
3294AOT_theorem "en-eq:1[4]": x1x2x3x4[F]  x1x2x3x4[F]
3295  using "pre-en-eq:1[4]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by fast
3296
3297AOT_theorem "en-eq:2[1]": x1[F]  x1[F]
3298  by (simp add: "≡I" "pre-en-eq:1[1]" "qml:2"[axiom_inst])
3299AOT_theorem "en-eq:2[2]": x1x2[F]  x1x2[F]
3300  by (simp add: "≡I" "pre-en-eq:1[2]" "qml:2"[axiom_inst])
3301AOT_theorem "en-eq:2[3]": x1x2x3[F]  x1x2x3[F]
3302  by (simp add: "≡I" "pre-en-eq:1[3]" "qml:2"[axiom_inst])
3303AOT_theorem "en-eq:2[4]": x1x2x3x4[F]  x1x2x3x4[F]
3304  by (simp add: "≡I" "pre-en-eq:1[4]" "qml:2"[axiom_inst])
3305
3306AOT_theorem "en-eq:3[1]": x1[F]  x1[F]
3307  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[1]"] "≡I" by blast
3308AOT_theorem "en-eq:3[2]": x1x2[F]  x1x2[F]
3309  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[2]"] "≡I" by blast
3310AOT_theorem "en-eq:3[3]": x1x2x3[F]  x1x2x3[F]
3311  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[3]"] "≡I" by blast
3312AOT_theorem "en-eq:3[4]": x1x2x3x4[F]  x1x2x3x4[F]
3313  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[4]"] "≡I" by blast
3314
3315AOT_theorem "en-eq:4[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3316  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3317  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[1]" by blast+
3318AOT_theorem "en-eq:4[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3319  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3320  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[2]" by blast+
3321AOT_theorem "en-eq:4[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3322  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3323  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[3]" by blast+
3324AOT_theorem "en-eq:4[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3325  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3326  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[4]" by blast+
3327
3328AOT_theorem "en-eq:5[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3329  apply (rule "≡I"; rule "→I")
3330  using "en-eq:4[1]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3331  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3332        "&I"[OF "pre-en-eq:1[1]"[THEN RN], OF "pre-en-eq:1[1]"[THEN RN]] by blast
3333AOT_theorem "en-eq:5[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3334  apply (rule "≡I"; rule "→I")
3335  using "en-eq:4[2]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3336  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3337        "&I"[OF "pre-en-eq:1[2]"[THEN RN], OF "pre-en-eq:1[2]"[THEN RN]] by blast
3338AOT_theorem "en-eq:5[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3339  apply (rule "≡I"; rule "→I")
3340  using "en-eq:4[3]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3341  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3342        "&I"[OF "pre-en-eq:1[3]"[THEN RN], OF "pre-en-eq:1[3]"[THEN RN]] by blast
3343AOT_theorem "en-eq:5[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3344  apply (rule "≡I"; rule "→I")
3345  using "en-eq:4[4]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3346  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3347        "&I"[OF "pre-en-eq:1[4]"[THEN RN], OF "pre-en-eq:1[4]"[THEN RN]] by blast
3348
3349AOT_theorem "en-eq:6[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3350  using "en-eq:5[1]"[symmetric] "en-eq:4[1]" "≡E"(5) by fast
3351AOT_theorem "en-eq:6[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3352  using "en-eq:5[2]"[symmetric] "en-eq:4[2]" "≡E"(5) by fast
3353AOT_theorem "en-eq:6[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3354  using "en-eq:5[3]"[symmetric] "en-eq:4[3]" "≡E"(5) by fast
3355AOT_theorem "en-eq:6[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3356  using "en-eq:5[4]"[symmetric] "en-eq:4[4]" "≡E"(5) by fast
3357
3358AOT_theorem "en-eq:7[1]": ¬x1[F]  ¬x1[F]
3359  using "pre-en-eq:2[1]" "qml:2"[axiom_inst] "≡I" by blast
3360AOT_theorem "en-eq:7[2]": ¬x1x2[F]  ¬x1x2[F]
3361  using "pre-en-eq:2[2]" "qml:2"[axiom_inst] "≡I" by blast
3362AOT_theorem "en-eq:7[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3363  using "pre-en-eq:2[3]" "qml:2"[axiom_inst] "≡I" by blast
3364AOT_theorem "en-eq:7[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3365  using "pre-en-eq:2[4]" "qml:2"[axiom_inst] "≡I" by blast
3366
3367AOT_theorem "en-eq:8[1]": ¬x1[F]  ¬x1[F]
3368  using "en-eq:2[1]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3369AOT_theorem "en-eq:8[2]": ¬x1x2[F]  ¬x1x2[F]
3370  using "en-eq:2[2]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3371AOT_theorem "en-eq:8[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3372  using "en-eq:2[3]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3373AOT_theorem "en-eq:8[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3374  using "en-eq:2[4]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3375
3376AOT_theorem "en-eq:9[1]": ¬x1[F]  ¬x1[F]
3377  using "en-eq:7[1]" "en-eq:8[1]" "≡E"(5) by blast
3378AOT_theorem "en-eq:9[2]": ¬x1x2[F]  ¬x1x2[F]
3379  using "en-eq:7[2]" "en-eq:8[2]" "≡E"(5) by blast
3380AOT_theorem "en-eq:9[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3381  using "en-eq:7[3]" "en-eq:8[3]" "≡E"(5) by blast
3382AOT_theorem "en-eq:9[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3383  using "en-eq:7[4]" "en-eq:8[4]" "≡E"(5) by blast
3384
3385AOT_theorem "en-eq:10[1]": 𝒜x1[F]  x1[F]
3386  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[1]" "pre-en-eq:1[1]")
3387AOT_theorem "en-eq:10[2]": 𝒜x1x2[F]  x1x2[F]
3388  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[2]" "pre-en-eq:1[2]")
3389AOT_theorem "en-eq:10[3]": 𝒜x1x2x3[F]  x1x2x3[F]
3390  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[3]" "pre-en-eq:1[3]")
3391AOT_theorem "en-eq:10[4]": 𝒜x1x2x3x4[F]  x1x2x3x4[F]
3392  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[4]" "pre-en-eq:1[4]")
3393
3394AOT_theorem "oa-facts:1": O!x  O!x
3395proof(rule "→I")
3396  AOT_modally_strict {
3397    AOT_have x E!x]x  E!x
3398      by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
3399  } note θ = this
3400  AOT_assume O!x
3401  AOT_hence x E!x]x
3402    by (rule "=dfE"(2)[OF AOT_ordinary, rotated 1]) "cqt:2[lambda]"
3403  AOT_hence E!x using θ[THEN "≡E"(1)] by blast
3404  AOT_hence 0: E!x using "qml:3"[axiom_inst, THEN "→E"] by blast
3405  AOT_have x E!x]x
3406    by (AOT_subst_using subst: θ) (simp add: 0)
3407  AOT_thus O!x
3408    by (rule "=dfI"(2)[OF AOT_ordinary, rotated 1]) "cqt:2[lambda]"
3409qed
3410
3411AOT_theorem "oa-facts:2": A!x  A!x
3412proof(rule "→I")
3413  AOT_modally_strict {
3414    AOT_have x ¬E!x]x  ¬E!x
3415      by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
3416  } note θ = this
3417  AOT_assume A!x
3418  AOT_hence x ¬E!x]x
3419    by (rule "=dfE"(2)[OF AOT_abstract, rotated 1]) "cqt:2[lambda]"
3420  AOT_hence ¬E!x using θ[THEN "≡E"(1)] by blast
3421  AOT_hence ¬E!x using "KBasic2:1"[THEN "≡E"(2)] by blast
3422  AOT_hence 0: ¬E!x using "4"[THEN "→E"] by blast
3423  AOT_have 1: ¬E!x
3424    apply (AOT_subst "«¬E!x»" "«¬E!x»")
3425    using "KBasic2:1"[symmetric] apply blast
3426    using 0 by blast
3427  AOT_have x ¬E!x]x
3428    by (AOT_subst_using subst: θ) (simp add: 1)
3429  AOT_thus A!x
3430    by (rule "=dfI"(2)[OF AOT_abstract, rotated 1]) "cqt:2[lambda]"
3431qed
3432
3433AOT_theorem "oa-facts:3": O!x  O!x
3434  using "oa-facts:1" "B◇" "RM◇" "Hypothetical Syllogism" by blast
3435AOT_theorem "oa-facts:4": A!x  A!x
3436  using "oa-facts:2" "B◇" "RM◇" "Hypothetical Syllogism" by blast
3437
3438AOT_theorem "oa-facts:5": O!x  O!x
3439  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:1" "oa-facts:3")
3440
3441AOT_theorem "oa-facts:6": A!x  A!x
3442  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:2" "oa-facts:4")
3443
3444AOT_theorem "oa-facts:7": O!x  𝒜O!x
3445  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:1" "oa-facts:3")
3446
3447AOT_theorem "oa-facts:8": A!x  𝒜A!x
3448  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:2" "oa-facts:4")
3449
3450AOT_theorem "beta-C-meta": μ1...μn φ{μ1...μn, ν1...νn}]  (μ1...μn φ{μ1...μn, ν1...νn}]ν1...νn  φ{ν1...νn, ν1...νn})
3451  using "lambda-predicates:2"[axiom_inst] by blast
3452
3453AOT_theorem "beta-C-cor:1": (ν1...∀νn(μ1...μn φ{μ1...μn, ν1...νn}]))  ν1...∀νn (μ1...μn φ{μ1...μn, ν1...νn}]ν1...νn  φ{ν1...νn, ν1...νn})
3454  apply (rule "cqt-basic:14"[where 'a='a, THEN "→E"])
3455  using "beta-C-meta" "∀I" by fast
3456
3457AOT_theorem "beta-C-cor:2": μ1...μn φ{μ1...μn}]  ν1...∀νn (μ1...μn φ{μ1...μn}]ν1...νn  φ{ν1...νn})
3458  apply (rule "→I"; rule "∀I")
3459  using "beta-C-meta"[THEN "→E"] by fast
3460
3461(* TODO: syntax + double-check if this is really a faithful representation *)
3462theorem "beta-C-cor:3": assumes ν1νn. AOT_instance_of_cqt_2 (φ (AOT_term_of_var ν1νn))
3463  shows [v  ν1...∀νn (μ1...μn φ{ν1...νn,μ1...μn}]ν1...νn  φ{ν1...νn,ν1...νn})]
3464  using "cqt:2[lambda]"[axiom_inst, OF assms] "beta-C-cor:1"[THEN "→E"] "∀I" by fast
3465
3466AOT_theorem "betaC:1:a": μ1...μn φ{μ1...μn}]κ1...κn  φ{κ1...κn}
3467proof -
3468  AOT_modally_strict {
3469    AOT_assume μ1...μn φ{μ1...μn}]κ1...κn
3470    moreover AOT_have μ1...μn φ{μ1...μn}] and κ1...κn
3471      using calculation "cqt:5:a"[axiom_inst, THEN "→E"] "&E" by blast+
3472    ultimately AOT_show φ{κ1...κn}
3473      using "beta-C-cor:2"[THEN "→E", THEN "∀E"(1), THEN "≡E"(1)] by blast
3474  }
3475qed
3476
3477AOT_theorem "betaC:1:b": ¬φ{κ1...κn}  ¬μ1...μn φ{μ1...μn}]κ1...κn
3478  using "betaC:1:a" "raa-cor:3" by blast
3479
3480lemmas "β→C" = "betaC:1:a" "betaC:1:b"
3481
3482AOT_theorem "betaC:2:a": μ1...μn φ{μ1...μn}], κ1...κn, φ{κ1...κn}  μ1...μn φ{μ1...μn}]κ1...κn
3483proof -
3484  AOT_modally_strict {
3485    AOT_assume 1: μ1...μn φ{μ1...μn}] and 2: κ1...κn and 3: φ{κ1...κn}
3486    AOT_hence μ1...μn φ{μ1...μn}]κ1...κn
3487      using "beta-C-cor:2"[THEN "→E", OF 1, THEN "∀E"(1), THEN "≡E"(2)] by blast
3488  }
3489  AOT_thus μ1...μn φ{μ1...μn}], κ1...κn, φ{κ1...κn}  μ1...μn φ{μ1...μn}]κ1...κn
3490    by blast
3491qed
3492
3493AOT_theorem "betaC:2:b": μ1...μn φ{μ1...μn}], κ1...κn, ¬μ1...μn φ{μ1...μn}]κ1...κn  ¬φ{κ1...κn}
3494  using "betaC:2:a" "raa-cor:3" by blast
3495
3496lemmas "β←C" = "betaC:2:a" "betaC:2:b"
3497
3498AOT_theorem "eta-conversion-lemma1:1": Π  x1...xn [Π]x1...xn] = Π
3499  using "lambda-predicates:3"[axiom_inst] "∀I" "∀E"(1) "→I" by fast
3500
3501AOT_theorem "eta-conversion-lemma1:2": Π  ν1...νn [Π]ν1...νn] = Π
3502  using "eta-conversion-lemma1:1". (* TODO: spurious in the embedding *)
3503
3504(* match (τ) in "λa . ?b" ⇒ ‹match (τ') in "λa . ?b" ⇒ ‹fail›› ¦ _ ⇒ ‹ *)
3505
3506text‹Note: not explicitly part of PLM.›
3507AOT_theorem id_sym: assumes τ = τ' shows τ' = τ
3508  using "rule=E"[where φ="λ τ' . «τ' = τ»", rotated 1, OF assms]
3509        "=I"(1)[OF "t=t-proper:1"[THEN "→E", OF assms]] by auto
3510declare id_sym[sym]
3511
3512text‹Note: not explicitly part of PLM.›
3513AOT_theorem id_trans: assumes τ = τ' and τ' = τ'' shows τ = τ''
3514  using "rule=E" assms by blast
3515declare id_trans[trans]
3516
3517method "ηC" for Π :: <'a::{AOT_Term_id_2,AOT_κs}> = (match conclusion in "[v  τ{Π} = τ'{Π}]" for v τ τ'  3518rule "rule=E"[rotated 1, OF "eta-conversion-lemma1:2"[THEN "→E", of v "«[Π]»", symmetric]]
3519)
3520(*
3521AOT_theorem ‹[λy [λz [P]z]y → [λu [S]u]y] = [λy [P]y → [S]y]›
3522  apply ("ηC" "«[P]»") defer
3523   apply ("ηC" "«[S]»") defer
3524  oops
3525*)
3526(* TODO: proper representation of eta_conversion_lemma2 *)
3527
3528AOT_theorem "sub-des-lam:1": z1...zn  χ{z1...zn, ιx φ{x}}] & ιx φ{x} = ιx ψ{x}  z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, ιx ψ{x}}]
3529proof(rule "→I")
3530  AOT_assume A: z1...zn  χ{z1...zn, ιx φ{x}}] & ιx φ{x} = ιx ψ{x}
3531  AOT_show z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, ιx ψ{x}}]
3532    using "rule=E"[where φ="λ τ . «z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, τ}]»",
3533               OF "=I"(1)[OF A[THEN "&E"(1)]], OF A[THEN "&E"(2)]]
3534    by blast
3535qed
3536
3537AOT_theorem "sub-des-lam:2": ιx φ{x} = ιx ψ{x}  χ{ιx φ{x}} = χ{ιx ψ{x}} for χ :: ‹κ  𝗈›
3538  using "rule=E"[where φ="λ τ . «χ{ιx φ{x}} = χ{τ}»", OF "=I"(1)[OF "log-prop-prop:2"]] "→I" by blast
3539
3540AOT_theorem "prop-equiv": F = G  x (x[F]  x[G])
3541proof(rule "≡I"; rule "→I")
3542  AOT_assume F = G
3543  AOT_thus x (x[F]  x[G])
3544    by (rule "rule=E"[rotated]) (fact "oth-class-taut:3:a"[THEN GEN])
3545next
3546  AOT_assume x (x[F]  x[G])
3547  AOT_hence x[F]  x[G] for x using "∀E" by blast
3548  AOT_hence (x[F]  x[G]) for x using "en-eq:6[1]"[THEN "≡E"(1)] by blast
3549  AOT_hence x (x[F]  x[G]) by (rule GEN)
3550  AOT_hence x (x[F]  x[G]) using BF[THEN "→E"] by fast
3551  AOT_thus "F = G" using "p-identity-thm2:1"[THEN "≡E"(2)] by blast
3552qed
3553
3554AOT_theorem "relations:1":
3555  assumes INSTANCE_OF_CQT_2(φ)
3556  shows F x1...∀xn ([F]x1...xn  φ{x1...xn})
3557  apply (rule "∃I"(1)[where τ="«x1...xn φ{x1...xn}]»"])
3558  using "cqt:2[lambda]"[OF assms, axiom_inst] "beta-C-cor:2"[THEN "→E", THEN RN] by blast+
3559
3560AOT_theorem "relations:2":
3561  assumes INSTANCE_OF_CQT_2(φ)
3562  shows F x ([F]x  φ{x})
3563  using "relations:1" assms by blast
3564
3565AOT_theorem "block-paradox:1": ¬x G (x[G] & ¬[G]x)]
3566proof(rule RAA(2))
3567  let ="λ τ. «G (τ[G] & ¬[G]τ)»"
3568  AOT_assume A: x « x»]
3569  AOT_have x (A!x & F (x[F]  F = x « x»]))
3570    using "A-objects"[axiom_inst] by fast
3571  then AOT_obtain a where ξ: A!a & F (a[F]  F = x « x»])
3572    using "∃E"[rotated] by blast
3573  AOT_show ¬x G (x[G] & ¬[G]x)]
3574  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3575    AOT_assume B: x « x»]a
3576    AOT_hence G (a[G] & ¬[G]a) using "β→C" A by blast
3577    then AOT_obtain P where a[P] & ¬[P]a using "∃E"[rotated] by blast
3578    moreover AOT_have P = x « x»]
3579      using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1)] calculation[THEN "&E"(1)] by blast
3580    ultimately AOT_have ¬x « x»]a
3581      using "rule=E" "&E"(2) by fast
3582    AOT_thus ¬x G (x[G] & ¬[G]x)] using B RAA by blast
3583  next
3584    AOT_assume B: ¬x « x»]a
3585    AOT_hence ¬G (a[G] & ¬[G]a) using "β←C" "cqt:2[const_var]"[of a, axiom_inst] A by blast
3586    AOT_hence C: G ¬(a[G] & ¬[G]a) using "cqt-further:4"[THEN "→E"] by blast
3587    AOT_have G (a[G]  [G]a)
3588      by (AOT_subst "λ Π . «a[Π]  [Π]a»" "λ Π . «¬(a[Π] & ¬[Π]a)»")
3589         (auto simp: "oth-class-taut:1:a" C)
3590    AOT_hence ax « x»]  x « x»]a using "∀E" A by blast
3591    moreover AOT_have ax « x»] using ξ[THEN "&E"(2), THEN "∀E"(1), OF A, THEN "≡E"(2)]
3592      using "=I"(1)[OF A] by blast
3593    ultimately AOT_show ¬x G (x[G] & ¬[G]x)] using B "→E" RAA by blast
3594  qed
3595qed(simp)
3596
3597AOT_theorem "block-paradox:2": ¬F x([F]x  G(x[G] & ¬[G]x))
3598proof(rule RAA(2))
3599  AOT_assume F x ([F]x  G (x[G] & ¬[G]x))
3600  then AOT_obtain F where F_prop: x ([F]x  G (x[G] & ¬[G]x)) using "∃E"[rotated] by blast
3601  AOT_have x (A!x & G (x[G]  G = F))
3602    using "A-objects"[axiom_inst] by fast
3603  then AOT_obtain a where ξ: A!a & G (a[G]  G = F)
3604    using "∃E"[rotated] by blast
3605  AOT_show ¬F x([F]x  G(x[G] & ¬[G]x))
3606  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3607    AOT_assume B: [F]a
3608    AOT_hence G (a[G] & ¬[G]a) using F_prop[THEN "∀E"(2), THEN "≡E"(1)] by blast
3609    then AOT_obtain P where a[P] & ¬[P]a using "∃E"[rotated] by blast
3610    moreover AOT_have P = F
3611      using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1)] calculation[THEN "&E"(1)] by blast
3612    ultimately AOT_have ¬[F]a
3613      using "rule=E" "&E"(2) by fast
3614    AOT_thus ¬F x([F]x  G(x[G] & ¬[G]x)) using B RAA by blast
3615  next
3616    AOT_assume B: ¬[F]a
3617    AOT_hence ¬G (a[G] & ¬[G]a)
3618      using "oth-class-taut:4:b"[THEN "≡E"(1), OF F_prop[THEN "∀E"(2)[of _ _ a]], THEN "≡E"(1)] by simp
3619    AOT_hence C: G ¬(a[G] & ¬[G]a) using "cqt-further:4"[THEN "→E"] by blast
3620    AOT_have G (a[G]  [G]a)
3621      by (AOT_subst "λ Π . «a[Π]  [Π]a»" "λ Π . «¬(a[Π] & ¬[Π]a)»")
3622         (auto simp: "oth-class-taut:1:a" C)
3623    AOT_hence a[F]  [F]a using "∀E" by blast
3624    moreover AOT_have a[F] using ξ[THEN "&E"(2), THEN "∀E"(2), of F, THEN "≡E"(2)]
3625      using "=I"(2) by blast
3626    ultimately AOT_show ¬F x([F]x  G(x[G] & ¬[G]x)) using B "→E" RAA by blast
3627  qed
3628qed(simp)
3629
3630AOT_theorem "block-paradox:3": ¬y z z = y]
3631proof(rule RAA(2))
3632  AOT_assume θ: y z z = y]
3633  AOT_have x (A!x & F (x[F]  y(F = z z = y] & ¬y[F])))
3634    using "A-objects"[axiom_inst] by force
3635  then AOT_obtain a where a_prop: A!a & F (a[F]  y (F = z z = y] & ¬y[F]))
3636    using "∃E"[rotated] by blast
3637  AOT_have ζ: az z = a]  y (z z = a] = z z = y] & ¬yz z = a])
3638    using θ[THEN "∀E"(2)] a_prop[THEN "&E"(2), THEN "∀E"(1)] by blast
3639  AOT_show ¬y z z = y]
3640  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3641    AOT_assume A: az z = a]
3642    AOT_hence y (z z = a] = z z = y] & ¬yz z = a])
3643      using ζ[THEN "≡E"(1)] by blast
3644    then AOT_obtain b where b_prop: z z = a] = z z = b] & ¬bz z = a]
3645      using "∃E"[rotated] by blast
3646    moreover AOT_have a = a by (rule "=I")
3647    moreover AOT_have z z = a] using θ "∀E" by blast
3648    moreover AOT_have a using "cqt:2[const_var]"[axiom_inst] .
3649    ultimately AOT_have z z = a]a using "β←C" by blast
3650    AOT_hence z z = b]a using "rule=E" b_prop[THEN "&E"(1)] by fast
3651    AOT_hence a = b using "β→C" by blast
3652    AOT_hence bz z = a] using A "rule=E" by fast
3653    AOT_thus ¬y z z = y] using b_prop[THEN "&E"(2)] RAA by blast
3654  next
3655    AOT_assume A: ¬az z = a]
3656    AOT_hence ¬y (z z = a] = z z = y] & ¬yz z = a])
3657      using ζ "oth-class-taut:4:b"[THEN "≡E"(1), THEN "≡E"(1)] by blast
3658    AOT_hence y ¬(z z = a] = z z = y] & ¬yz z = a])
3659      using "cqt-further:4"[THEN "→E"] by blast
3660    AOT_hence ¬(z z = a] = z z = a] & ¬az z = a])
3661      using "∀E" by blast
3662    AOT_hence z z = a] = z z = a]  az z = a]
3663      by (metis "&I" "deduction-theorem" "raa-cor:4")
3664    AOT_hence az z = a] using "=I"(1) θ[THEN "∀E"(2)] "→E" by blast
3665    AOT_thus ¬y z z = y] using A RAA by blast
3666  qed
3667qed(simp)
3668
3669AOT_theorem "block-paradox:4": ¬y F x([F]x  x = y)
3670proof(rule RAA(2))
3671  AOT_assume θ: y F x([F]x  x = y)
3672  AOT_have x (A!x & F (x[F]  z (y([F]y  y = z) & ¬z[F])))
3673    using "A-objects"[axiom_inst] by force
3674  then AOT_obtain a where a_prop: A!a & F (a[F]  z (y([F]y  y = z) & ¬z[F]))
3675    using "∃E"[rotated] by blast
3676  AOT_obtain F where F_prop: x ([F]x  x = a) using θ[THEN "∀E"(2)] "∃E"[rotated] by blast
3677  AOT_have ζ: a[F]  z (y ([F]y  y = z) & ¬z[F])
3678    using a_prop[THEN "&E"(2), THEN "∀E"(2)] by blast
3679  AOT_show ¬y F x([F]x  x = y)
3680  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3681    AOT_assume A: a[F]
3682    AOT_hence z (y ([F]y  y = z) & ¬z[F])
3683      using ζ[THEN "≡E"(1)] by blast
3684    then AOT_obtain b where b_prop: y ([F]y  y = b) & ¬b[F]
3685      using "∃E"[rotated] by blast
3686    moreover AOT_have [F]a using F_prop[THEN "∀E"(2), THEN "≡E"(2)] "=I"(2) by blast
3687    ultimately AOT_have a = b using "∀E"(2) "≡E"(1) "&E" by fast
3688    AOT_hence a = b using "β→C" by blast
3689    AOT_hence b[F] using A "rule=E" by fast
3690    AOT_thus ¬y F x([F]x  x = y) using b_prop[THEN "&E"(2)] RAA by blast
3691  next
3692    AOT_assume A: ¬a[F]
3693    AOT_hence ¬z (y ([F]y  y = z) & ¬z[F])
3694      using ζ "oth-class-taut:4:b"[THEN "≡E"(1), THEN "≡E"(1)] by blast
3695    AOT_hence z ¬(y ([F]y  y = z) & ¬z[F])
3696      using "cqt-further:4"[THEN "→E"] by blast
3697    AOT_hence ¬(y ([F]y  y = a) & ¬a[F])
3698      using "∀E" by blast
3699    AOT_hence y ([F]y  y = a)  a[F]
3700      by (metis "&I" "deduction-theorem" "raa-cor:4")
3701    AOT_hence a[F] using F_prop "→E" by blast
3702    AOT_thus ¬y F x([F]x  x = y) using A RAA by blast
3703  qed
3704qed(simp)
3705
3706AOT_theorem "block-paradox:5": ¬Fxy([F]xy  y = x)
3707proof(rule "raa-cor:2")
3708  AOT_assume Fxy([F]xy  y = x)
3709  then AOT_obtain F where F_prop: xy([F]xy  y = x) using "∃E"[rotated] by blast
3710  {
3711    fix x
3712    AOT_have 1: y([F]xy  y = x) using F_prop "∀E" by blast
3713    AOT_have 2: z [F]xz] by "cqt:2[lambda]"
3714    moreover AOT_have y(z [F]xz]y  y = x)
3715    proof(rule "∀I")
3716      fix y
3717      AOT_have z [F]xz]y  [F]xy
3718        using "beta-C-meta"[THEN "→E"] 2 by fast
3719      also AOT_have ...  y = x using 1 "∀E"
3720        by fast
3721      finally AOT_show z [F]xz]y  y = x.
3722    qed
3723    ultimately AOT_have Fy([F]y  y = x)
3724      using "∃I" by fast
3725  }
3726  AOT_hence xFy([F]y  y = x)
3727    by (rule GEN)
3728  AOT_thus xFy([F]y  y = x) & ¬xFy([F]y  y = x)
3729    using "&I" "block-paradox:4" by blast
3730qed
3731
3732AOT_act_theorem "block-paradox2:1": x [G]x  ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3733proof(rule "→I"; rule "raa-cor:2")
3734  AOT_assume antecedant: x [G]x
3735  AOT_have Lemma: x ([G]ιy(y = x & H (x[H] & ¬[H]x))  H (x[H] & ¬[H]x))
3736  proof(rule GEN)
3737    fix x
3738    AOT_have A: [G]ιy (y = x & H (x[H] & ¬[H]x))  ∃!y (y = x & H (x[H] & ¬[H]x))
3739    proof(rule "≡I"; rule "→I")
3740      AOT_assume [G]ιy (y = x & H (x[H] & ¬[H]x))
3741      AOT_hence ιy (y = x & H (x[H] & ¬[H]x))
3742        using "cqt:5:a"[axiom_inst, THEN "→E", THEN "&E"(2)] by blast
3743      AOT_thus ∃!y (y = x & H (x[H] & ¬[H]x))
3744        using "1-exists:1"[THEN "≡E"(1)] by blast
3745    next
3746      AOT_assume A: ∃!y (y = x & H (x[H] & ¬[H]x))
3747      AOT_obtain a where a_1: a = x & H (x[H] & ¬[H]x) and a_2: z (z = x & H (x[H] & ¬[H]x)  z = a)
3748        using "uniqueness:1"[THEN "≡dfE", OF A] "&E" "∃E"[rotated] by blast
3749      AOT_have a_3: [G]a
3750        using antecedant "∀E" by blast
3751      AOT_show [G]ιy (y = x & H (x[H] & ¬[H]x))
3752        apply (rule "russell-axiom[exe,1].russell-axiom"[THEN "≡E"(2)])
3753        apply (rule "∃I"(2))
3754        using a_1 a_2 a_3 "&I" by blast
3755    qed
3756    also AOT_have B: ...  H (x[H] & ¬[H]x)
3757    proof (rule "≡I"; rule "→I")
3758      AOT_assume A: ∃!y (y = x & H (x[H] & ¬[H]x))
3759      AOT_obtain a where a = x & H (x[H] & ¬[H]x)
3760        using "uniqueness:1"[THEN "≡dfE", OF A] "&E" "∃E"[rotated] by blast
3761      AOT_thus H (x[H] & ¬[H]x) using "&E" by blast
3762    next
3763      AOT_assume H (x[H] & ¬[H]x)
3764      AOT_hence x = x & H (x[H] & ¬[H]x)
3765        using "id-eq:1" "&I" by blast
3766      moreover AOT_have z (z = x & H (x[H] & ¬[H]x)  z = x)
3767        by (simp add: "Conjunction Simplification"(1) "universal-cor")
3768      ultimately AOT_show ∃!y (y = x & H (x[H] & ¬[H]x))
3769        using "uniqueness:1"[THEN "≡dfI"] "&I" "∃I"(2) by fast
3770    qed
3771    finally AOT_show ([G]ιy(y = x & H (x[H] & ¬[H]x))  H (x[H] & ¬[H]x)) .
3772  qed
3773
3774  AOT_assume A: x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3775  AOT_have θ: x (x [G]ιy (y = x & H (x[H] & ¬[H]x))]x  [G]ιy(y = x & H (x[H] & ¬[H]x)))
3776    using "beta-C-meta"[THEN "→E", OF A] "∀I" by fast
3777  AOT_have x (x [G]ιy (y = x & H (x[H] & ¬[H]x))]x  H (x[H] & ¬[H]x))
3778    using θ Lemma "cqt-basic:10"[THEN "→E"] "&I" by fast
3779  AOT_hence F x ([F]x  H (x[H] & ¬[H]x))
3780    using "∃I"(1) A by fast
3781  AOT_thus (F x ([F]x  H (x[H] & ¬[H]x))) & (¬F x ([F]x  H (x[H] & ¬[H]x)))
3782    using "block-paradox:2" "&I" by blast
3783qed
3784
3785AOT_act_theorem "block-paradox2:2": G ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3786proof(rule "∃I"(1))
3787  AOT_have 0: x p (p p)]
3788    by "cqt:2[lambda]"
3789  moreover AOT_have x x p (p p)]x
3790    apply (rule GEN)
3791    apply (rule "beta-C-cor:2"[THEN "→E", OF 0, THEN "∀E"(2), THEN "≡E"(2)])
3792    using "if-p-then-p" GEN by fast
3793  moreover AOT_have G (x [G]x  ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))])
3794      using "block-paradox2:1" "∀I" by fast
3795  ultimately AOT_show ¬x x p (p p)]ιy (y = x & H (x[H] & ¬[H]x))]
3796    using "∀E"(1) "→E" by blast
3797qed("cqt:2[lambda]")
3798
3799AOT_theorem propositions: p (p  φ)
3800proof(rule "∃I"(1))
3801  AOT_show (φ  φ)
3802    by (simp add: RN "oth-class-taut:3:a")
3803next
3804  AOT_show φ
3805    by (simp add: "log-prop-prop:2")
3806qed
3807
3808AOT_theorem "pos-not-equiv-ne:1": (¬x1...∀xn ([F]x1...xn  [G]x1...xn))  F  G
3809proof (rule "→I")
3810  AOT_assume ¬x1...∀xn ([F]x1...xn  [G]x1...xn)
3811  AOT_hence ¬x1...∀xn ([F]x1...xn  [G]x1...xn)
3812    using "KBasic:11"[THEN "≡E"(2)] by blast
3813  AOT_hence ¬(F = G)
3814    using "id-rel-nec-equiv:1" "modus-tollens:1" by blast
3815  AOT_thus F  G
3816    using "=-infix"[THEN "≡dfI"] by blast
3817qed
3818
3819AOT_theorem "pos-not-equiv-ne:2": (¬(φ{F}  φ{G}))  F  G
3820proof (rule "→I")
3821  AOT_modally_strict {
3822    AOT_have ¬(φ{F}  φ{G})  ¬(F = G)
3823    proof (rule "→I"; rule "raa-cor:2")
3824      AOT_assume 1: F = G
3825      AOT_hence φ{F}  φ{G} using "l-identity"[axiom_inst, THEN "→E"] by blast
3826      moreover {
3827        AOT_have G = F using 1 id_sym by blast
3828        AOT_hence φ{G}  φ{F} using "l-identity"[axiom_inst, THEN "→E"] by blast
3829      }
3830      ultimately AOT_have φ{F}  φ{G} using "≡I" by blast
3831      moreover AOT_assume ¬(φ{F}  φ{G})
3832      ultimately AOT_show (φ{F}  φ{G}) & ¬(φ{F}  φ{G})
3833        using "&I" by blast
3834    qed
3835  }
3836  AOT_hence ¬(φ{F}  φ{G})  ¬(F = G)
3837    using "RM:2[prem]" by blast
3838  moreover AOT_assume ¬(φ{F}  φ{G})
3839  ultimately AOT_have 0: ¬(F = G) using "→E" by blast
3840  AOT_have (F  G)
3841    by (AOT_subst "«F  G»" "«¬(F = G)»")
3842       (auto simp: "=-infix" "≡Df" 0)
3843  AOT_thus F  G
3844    using "id-nec2:3"[THEN "→E"] by blast
3845qed
3846
3847AOT_theorem "pos-not-equiv-ne:2[zero]": (¬(φ{p}  φ{q}))  p  q
3848proof (rule "→I")
3849  AOT_modally_strict {
3850    AOT_have ¬(φ{p}  φ{q})  ¬(p = q)
3851    proof (rule "→I"; rule "raa-cor:2")
3852      AOT_assume 1: p = q
3853      AOT_hence φ{p}  φ{q} using "l-identity"[axiom_inst, THEN "→E"] by blast
3854      moreover {
3855        AOT_have q = p using 1 id_sym by blast
3856        AOT_hence φ{q}  φ{p} using "l-identity"[axiom_inst, THEN "→E"] by blast
3857      }
3858      ultimately AOT_have φ{p}  φ{q} using "≡I" by blast
3859      moreover AOT_assume ¬(φ{p}  φ{q})
3860      ultimately AOT_show (φ{p}  φ{q}) & ¬(φ{p}  φ{q})
3861        using "&I" by blast
3862    qed
3863  }
3864  AOT_hence ¬(φ{p}  φ{q})  ¬(p = q)
3865    using "RM:2[prem]" by blast
3866  moreover AOT_assume ¬(φ{p}  φ{q})
3867  ultimately AOT_have 0: ¬(p = q) using "→E" by blast
3868  AOT_have (p  q)
3869    by (AOT_subst "«p  q»" "«¬(p = q)»")
3870       (auto simp: 0 "=-infix" "≡Df")
3871  AOT_thus p  q
3872    using "id-nec2:3"[THEN "→E"] by blast
3873qed
3874
3875AOT_theorem "pos-not-equiv-ne:3": (¬x1...∀xn ([F]x1...xn  [G]x1...xn))  F  G
3876  using "→I" "pos-not-equiv-ne:1"[THEN "→E"] "T◇"[THEN "→E"] by blast
3877
3878AOT_theorem "pos-not-equiv-ne:4": (¬(φ{F}  φ{G}))  F  G
3879  using "→I" "pos-not-equiv-ne:2"[THEN "→E"] "T◇"[THEN "→E"] by blast
3880
3881AOT_theorem "pos-not-equiv-ne:4[zero]": (¬(φ{p}  φ{q}))  p  q
3882  using "→I" "pos-not-equiv-ne:2[zero]"[THEN "→E"] "T◇"[THEN "→E"] by blast
3883
3884AOT_define relation_negation ::  Π" ("_-")
3885  "df-relation-negation": "[F]- =df x1...xn ¬[F]x1...xn]"
3886
3887nonterminal φneg
3888syntax "" :: "φneg  τ" ("_")
3889syntax "" :: "φneg  φ" ("'(_')")
3890
3891AOT_define relation_negation_0 :: ‹φ  φneg› ("'(_')-")
3892  "df-relation-negation[zero]": "(p)- =df  ¬p]"
3893
3894AOT_theorem "rel-neg-T:1": x1...xn ¬[Π]x1...xn]
3895  by "cqt:2[lambda]"
3896
3897AOT_theorem "rel-neg-T:1[zero]":  ¬φ]
3898  using "cqt:2[lambda0]"[axiom_inst] by blast
3899
3900AOT_theorem "rel-neg-T:2": [Π]- = x1...xn ¬[Π]x1...xn]
3901  using "=I"(1)[OF "rel-neg-T:1"]
3902  by (rule "=dfI"(1)[OF "df-relation-negation", OF "rel-neg-T:1"])
3903
3904AOT_theorem "rel-neg-T:2[zero]": (φ)- =  ¬φ]
3905  using "=I"(1)[OF "rel-neg-T:1[zero]"]
3906  by (rule "=dfI"(1)[OF "df-relation-negation[zero]", OF "rel-neg-T:1[zero]"])
3907
3908AOT_theorem "rel-neg-T:3": [Π]-
3909  using "=dfI"(1)[OF "df-relation-negation", OF "rel-neg-T:1"] "rel-neg-T:1" by blast
3910
3911AOT_theorem "rel-neg-T:3[zero]": (φ)-
3912  using "log-prop-prop:2" by blast
3913(*  using "=dfI"(1)[OF "df-relation-negation[zero]", OF "rel-neg-T:1[zero]"] "rel-neg-T:1[zero]" by blast *)
3914
3915(* Note: PLM states the zero place case twice *)
3916AOT_theorem "thm-relation-negation:1": [F]-x1...xn  ¬[F]x1...xn
3917proof -
3918  AOT_have [F]-x1...xn  x1...xn ¬[F]x1...xn]x1...xn
3919    using "rule=E"[rotated, OF "rel-neg-T:2"] "rule=E"[rotated, OF "rel-neg-T:2"[THEN id_sym]]
3920    "→I" "≡I" by fast
3921  also AOT_have ...  ¬[F]x1...xn
3922    using "beta-C-meta"[THEN "→E", OF "rel-neg-T:1"] by fast
3923  finally show ?thesis.
3924qed
3925
3926AOT_theorem "thm-relation-negation:2": ¬[F]-x1...xn  [F]x1...xn
3927  apply (AOT_subst "«[F]x1...xn»" "«¬¬[F]x1...xn»")
3928   apply (simp add: "oth-class-taut:3:b")
3929  apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
3930  using "thm-relation-negation:1".
3931
3932AOT_theorem "thm-relation-negation:3": ((p)-)  ¬p
3933proof -
3934  AOT_have (p)- =  ¬p] using "rel-neg-T:2[zero]" by blast
3935  AOT_hence ((p)-)   ¬p]
3936    using "df-relation-negation[zero]" "log-prop-prop:2" "oth-class-taut:3:a" "rule-id-def:2:a" by blast
3937  also AOT_have  ¬p]  ¬p
3938    by (simp add: "propositions-lemma:2")
3939  finally show ?thesis.
3940qed
3941
3942AOT_theorem "thm-relation-negation:4": (¬((p)-))  p
3943  using "thm-relation-negation:3"[THEN "≡E"(1)]
3944        "thm-relation-negation:3"[THEN "≡E"(2)]
3945        "≡I" "→I" RAA by metis
3946
3947AOT_theorem "thm-relation-negation:5": [F]  [F]-
3948proof -
3949  AOT_have ¬([F] = [F]-)
3950  proof (rule RAA(2))
3951    AOT_show [F]x1...xn  [F]x1...xn for x1xn
3952      using "if-p-then-p".
3953  next
3954    AOT_assume [F] = [F]-
3955    AOT_hence [F]- = [F] using id_sym by blast
3956    AOT_hence [F]x1...xn  ¬[F]x1...xn for x1xn
3957      using "rule=E" "thm-relation-negation:1" by fast
3958    AOT_thus ¬([F]x1...xn  [F]x1...xn) for x1xn
3959      using "≡E" RAA by metis
3960  qed
3961  thus ?thesis
3962    using "≡dfI" "=-infix" by blast
3963qed
3964
3965AOT_theorem "thm-relation-negation:6": p  (p)-
3966proof -
3967  AOT_have ¬(p = (p)-)
3968  proof (rule RAA(2))
3969    AOT_show p  p
3970      using "if-p-then-p".
3971  next
3972    AOT_assume p = (p)-
3973    AOT_hence (p)- = p using id_sym by blast
3974    AOT_hence p  ¬p
3975      using "rule=E" "thm-relation-negation:3" by fast
3976    AOT_thus ¬(p  p)
3977      using "≡E" RAA by metis
3978  qed
3979  thus ?thesis
3980    using "≡dfI" "=-infix" by blast
3981qed
3982
3983AOT_theorem "thm-relation-negation:7": (p)- = (¬p)
3984  apply (rule "df-relation-negation[zero]"[THEN "=dfE"(1)])
3985  using "cqt:2[lambda0]"[axiom_inst] "rel-neg-T:2[zero]" "propositions-lemma:1" id_trans by blast+
3986
3987AOT_theorem "thm-relation-negation:8": p = q  (¬p) = (¬q)
3988proof(rule "→I")
3989  AOT_assume p = q
3990  moreover AOT_have (¬p) using "log-prop-prop:2".
3991  moreover AOT_have (¬p) = (¬p) using calculation(2) "=I" by blast
3992  ultimately AOT_show (¬p) = (¬q)
3993    using "rule=E" by fast
3994qed
3995
3996AOT_theorem "thm-relation-negation:9": p = q  (p)- = (q)-
3997proof(rule "→I")
3998  AOT_assume p = q
3999  AOT_hence (¬p) = (¬q) using "thm-relation-negation:8" "→E" by blast
4000  AOT_thus (p)- = (q)-
4001    using "thm-relation-negation:7" id_sym id_trans by metis
4002qed
4003
4004AOT_define Necessary :: ‹Π  φ› ("Necessary'(_')")
4005  "contingent-properties:1": Necessary([F]) df x1...∀xn [F]x1...xn
4006
4007AOT_define Necessary0 :: ‹φ  φ› ("Necessary0'(_')")
4008  "contingent-properties:1[zero]": Necessary0(p) df p
4009
4010AOT_define Impossible :: ‹Π  φ› ("Impossible'(_')")
4011  "contingent-properties:2": Impossible([F]) df F & x1...∀xn ¬[F]x1...xn
4012
4013AOT_define Impossible0 :: ‹φ  φ› ("Impossible0'(_')")
4014  "contingent-properties:2[zero]": Impossible0(p) df ¬p
4015
4016AOT_define NonContingent :: ‹Π  φ› ("NonContingent'(_')")
4017  "contingent-properties:3": NonContingent([F]) df Necessary([F])  Impossible([F])
4018
4019AOT_define NonContingent0 :: ‹φ  φ› ("NonContingent0'(_')")
4020  "contingent-properties:3[zero]": NonContingent0(p) df Necessary0(p)  Impossible0(p)
4021
4022AOT_define Contingent :: ‹Π  φ› ("Contingent'(_')")
4023  "contingent-properties:4": Contingent([F]) df F & ¬(Necessary([F])  Impossible([F]))
4024
4025AOT_define Contingent0 :: ‹φ  φ› ("Contingent0'(_')")
4026  "contingent-properties:4[zero]": Contingent0(p) df ¬(Necessary0(p)  Impossible0(p))
4027
4028
4029AOT_theorem "thm-cont-prop:1": NonContingent([F])  NonContingent([F]-)
4030proof (rule "≡I"; rule "→I")
4031  AOT_assume NonContingent([F])
4032  AOT_hence Necessary([F])  Impossible([F])
4033    using "≡dfE"[OF "contingent-properties:3"] by blast
4034  moreover {
4035    AOT_assume Necessary([F])
4036    AOT_hence (x1...∀xn [F]x1...xn)
4037      using "≡dfE"[OF "contingent-properties:1"] by blast
4038    moreover AOT_modally_strict {
4039      AOT_assume x1...∀xn [F]x1...xn
4040      AOT_hence [F]x1...xn for x1xn using "∀E" by blast
4041      AOT_hence ¬[F]-x1...xn for x1xn
4042        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:2" "≡E"(1))
4043      AOT_hence x1...∀xn ¬[F]-x1...xn using "∀I" by fast
4044    }
4045    ultimately AOT_have (x1...∀xn ¬[F]-x1...xn)
4046      using "RN[prem]"[where Γ="{«x1...∀xn [F]x1...xn»}", simplified] by blast
4047    AOT_hence Impossible([F]-)
4048      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "rel-neg-T:3", THEN "≡E"(2)]
4049      by blast
4050  }
4051  moreover {
4052    AOT_assume Impossible([F])
4053    AOT_hence (x1...∀xn ¬[F]x1...xn)
4054      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)]
4055      by blast
4056    moreover AOT_modally_strict {
4057      AOT_assume x1...∀xn ¬[F]x1...xn
4058      AOT_hence ¬[F]x1...xn for x1xn using "∀E" by blast
4059      AOT_hence [F]-x1...xn for x1xn
4060        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:1" "≡E"(1))
4061      AOT_hence x1...∀xn [F]-x1...xn using "∀I" by fast
4062    }
4063    ultimately AOT_have (x1...∀xn [F]-x1...xn)
4064      using "RN[prem]"[where Γ="{«x1...∀xn ¬[F]x1...xn»}"] by blast
4065    AOT_hence Necessary([F]-)
4066      using "≡dfI"[OF "contingent-properties:1"] by blast
4067  }
4068  ultimately AOT_have Necessary([F]-)  Impossible([F]-)
4069    using "∨E"(1) "∨I" "→I" by metis
4070  AOT_thus NonContingent([F]-)
4071    using "≡dfI"[OF "contingent-properties:3"] by blast
4072next
4073  AOT_assume NonContingent([F]-)
4074  AOT_hence Necessary([F]-)  Impossible([F]-)
4075    using "≡dfE"[OF "contingent-properties:3"] by blast
4076  moreover {
4077    AOT_assume Necessary([F]-)
4078    AOT_hence (x1...∀xn [F]-x1...xn)
4079      using "≡dfE"[OF "contingent-properties:1"] by blast
4080    moreover AOT_modally_strict {
4081      AOT_assume x1...∀xn [F]-x1...xn
4082      AOT_hence [F]-x1...xn for x1xn using "∀E" by blast
4083      AOT_hence ¬[F]x1...xn for x1xn
4084        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:1" "≡E"(2))
4085      AOT_hence x1...∀xn ¬[F]x1...xn using "∀I" by fast
4086    }
4087    ultimately AOT_have x1...∀xn ¬[F]x1...xn
4088      using "RN[prem]"[where Γ="{«x1...∀xn [F]-x1...xn»}"] by blast
4089    AOT_hence Impossible([F])
4090      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(2)]
4091      by blast
4092  }
4093  moreover {
4094    AOT_assume Impossible([F]-)
4095    AOT_hence (x1...∀xn ¬[F]-x1...xn)
4096      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "rel-neg-T:3", THEN "≡E"(1)]
4097      by blast
4098    moreover AOT_modally_strict {
4099      AOT_assume x1...∀xn ¬[F]-x1...xn
4100      AOT_hence ¬[F]-x1...xn for x1xn using "∀E" by blast
4101      AOT_hence [F]x1...xn for x1xn 
4102        using "thm-relation-negation:1"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4103              "useful-tautologies:1"[THEN "→E"] by blast
4104      AOT_hence x1...∀xn [F]x1...xn using "∀I" by fast
4105    }
4106    ultimately AOT_have (x1...∀xn [F]x1...xn)
4107      using "RN[prem]"[where Γ="{«x1...∀xn ¬[F]-x1...xn»}"] by blast
4108    AOT_hence Necessary([F])
4109      using "≡dfI"[OF "contingent-properties:1"] by blast
4110  }
4111  ultimately AOT_have Necessary([F])  Impossible([F])
4112    using "∨E"(1) "∨I" "→I" by metis
4113  AOT_thus NonContingent([F])
4114    using "≡dfI"[OF "contingent-properties:3"] by blast
4115qed
4116
4117AOT_theorem "thm-cont-prop:2": Contingent([F])  x [F]x & x ¬[F]x
4118proof -
4119  AOT_have Contingent([F])  ¬(Necessary([F])  Impossible([F]))
4120    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst]]
4121    by blast
4122  also AOT_have ...  ¬Necessary([F]) & ¬Impossible([F])
4123    using "oth-class-taut:5:d" by fastforce
4124  also AOT_have ...  ¬Impossible([F]) & ¬Necessary([F])
4125    by (simp add: "Commutativity of &")
4126  also AOT_have ...  x [F]x & ¬Necessary([F])
4127  proof (rule "oth-class-taut:4:e"[THEN "→E"])
4128    AOT_have ¬Impossible([F])  ¬¬ x [F]x
4129      apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4130      apply (AOT_subst "«x [F]x»" "«¬ x ¬[F]x»")
4131       apply (simp add: "conventions:4" "≡Df")
4132      apply (AOT_subst_rev "«x ¬[F]x»" "«¬¬x ¬[F]x»" )
4133       apply (simp add: "oth-class-taut:3:b")
4134      using "contingent-properties:2"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst]] by blast
4135    also AOT_have ...  x [F]x
4136      using "conventions:5"[THEN "≡Df", symmetric] by blast
4137    finally AOT_show ¬Impossible([F])  x [F]x .
4138  qed
4139  also AOT_have ...  x [F]x & x ¬[F]x
4140  proof (rule "oth-class-taut:4:f"[THEN "→E"])
4141    AOT_have ¬Necessary([F])  ¬¬x ¬[F]x
4142      apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4143      apply (AOT_subst "«x ¬[F]x»" "«¬ x ¬¬[F]x»")
4144       apply (simp add: "conventions:4" "≡Df")
4145      apply (AOT_subst_rev "λ κ . «[F]κ»" "λ κ . «¬¬[F]κ»")
4146       apply (simp add: "oth-class-taut:3:b")
4147      apply (AOT_subst_rev "«x [F]x»" "«¬¬x [F]x»")
4148      by (auto simp: "oth-class-taut:3:b" "contingent-properties:1" "≡Df")
4149    also AOT_have ...  x ¬[F]x
4150      using "conventions:5"[THEN "≡Df", symmetric] by blast
4151    finally AOT_show ¬Necessary([F])  x ¬[F]x.
4152  qed
4153  finally show ?thesis.
4154qed
4155
4156AOT_theorem "thm-cont-prop:3": Contingent([F])  Contingent([F]-) for F::<κ> AOT_var›
4157proof -
4158  {
4159    fix Π :: <κ>
4160    AOT_assume Π
4161    moreover AOT_have F (Contingent([F])  x [F]x & x ¬[F]x)
4162      using "thm-cont-prop:2" GEN by fast
4163    ultimately  AOT_have Contingent([Π])  x [Π]x & x ¬[Π]x
4164      using "thm-cont-prop:2" "∀E" by fast
4165  } note 1 = this
4166  AOT_have Contingent([F])  x [F]x & x ¬[F]x
4167    using "thm-cont-prop:2" by blast
4168  also AOT_have ...  x ¬[F]x & x [F]x
4169    by (simp add: "Commutativity of &")
4170  also AOT_have ...  x [F]-x & x [F]x
4171    by (AOT_subst "λ κ . «[F]-κ»"  "λκ . «¬[F]κ»")
4172       (auto simp: "thm-relation-negation:1" "oth-class-taut:3:a")
4173  also AOT_have ...  x [F]-x & x ¬[F]-x
4174    by (AOT_subst_rev "λ κ . «¬[F]-κ»"  "λκ . «[F]κ»")
4175       (auto simp: "thm-relation-negation:2" "oth-class-taut:3:a")
4176  also AOT_have ...  Contingent([F]-)
4177    using 1[OF "rel-neg-T:3", symmetric] by blast
4178  finally show ?thesis.
4179qed
4180
4181AOT_define concrete_if_concrete :: ‹Π› ("L")  L_def: L =df x E!x  E!x]
4182
4183AOT_theorem "thm-noncont-e-e:1": Necessary(L)
4184proof -
4185  AOT_modally_strict {
4186    fix x
4187    AOT_have x E!x  E!x] by "cqt:2[lambda]"
4188    moreover AOT_have x using "cqt:2[const_var]"[axiom_inst] by blast
4189    moreover AOT_have E!x  E!x using "if-p-then-p" by blast
4190    ultimately AOT_have x E!x  E!x]x
4191      using "β←C" by blast
4192  }
4193  AOT_hence 0: x x E!x  E!x]x
4194    using RN GEN by blast
4195  show ?thesis
4196    apply (rule "=dfI"(2)[OF L_def])
4197     apply "cqt:2[lambda]"
4198    by (rule "contingent-properties:1"[THEN "≡dfI", OF 0])
4199qed
4200
4201AOT_theorem "thm-noncont-e-e:2": Impossible([L]-)
4202proof -
4203  AOT_modally_strict {
4204    fix x
4205
4206    AOT_have 0: F (¬[F]-x  [F]x)
4207      using "thm-relation-negation:2" GEN by fast
4208    AOT_have ¬x E!x  E!x]-x  x E!x  E!x]x
4209      by (rule 0[THEN "∀E"(1)]) "cqt:2[lambda]"
4210    moreover {
4211      AOT_have x E!x  E!x] by "cqt:2[lambda]"
4212      moreover AOT_have x using "cqt:2[const_var]"[axiom_inst] by blast
4213      moreover AOT_have E!x  E!x using "if-p-then-p" by blast
4214      ultimately AOT_have x E!x  E!x]x
4215        using "β←C" by blast
4216    }
4217    ultimately AOT_have ¬x E!x  E!x]-x
4218      using "≡E" by blast
4219  }
4220  AOT_hence 0: x ¬x E!x  E!x]-x
4221    using RN GEN by fast
4222  show ?thesis
4223    apply (rule "=dfI"(2)[OF L_def])
4224     apply "cqt:2[lambda]"
4225    apply (rule "contingent-properties:2"[THEN "≡dfI"]; rule "&I")
4226     using "rel-neg-T:3"
4227     apply blast
4228    using 0
4229    by blast
4230qed
4231
4232AOT_theorem "thm-noncont-e-e:3": NonContingent(L)
4233  using "thm-noncont-e-e:1"
4234  by (rule "contingent-properties:3"[THEN "≡dfI", OF "∨I"(1)])
4235
4236AOT_theorem "thm-noncont-e-e:4": NonContingent([L]-)
4237proof -
4238  AOT_have 0: F (NonContingent([F])  NonContingent([F]-))
4239    using "thm-cont-prop:1" "∀I" by fast
4240  moreover AOT_have 1: L
4241    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4242  AOT_show NonContingent([L]-)
4243    using "∀E"(1)[OF 0, OF 1, THEN "≡E"(1), OF "thm-noncont-e-e:3"] by blast
4244qed
4245
4246AOT_theorem "thm-noncont-e-e:5": F G (F  «G::<κ>» & NonContingent([F]) & NonContingent([G]))
4247proof (rule "∃I")+
4248  {
4249    AOT_have F [F]  [F]- using "thm-relation-negation:5" GEN by fast
4250    moreover AOT_have L
4251      by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4252    ultimately AOT_have L  [L]- using "∀E" by blast
4253  }
4254  AOT_thus L  [L]- & NonContingent(L) & NonContingent([L]-)
4255    using "thm-noncont-e-e:3" "thm-noncont-e-e:4" "&I" by metis
4256next
4257  AOT_show [L]-
4258    using "rel-neg-T:3" by blast
4259next
4260  AOT_show L
4261      by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4262qed
4263
4264AOT_theorem "lem-cont-e:1": x ([F]x & ¬[F]x)  x (¬[F]x & [F]x)
4265proof -
4266  AOT_have x ([F]x & ¬[F]x)  x ([F]x & ¬[F]x)
4267    using "BF◇" "CBF◇" "≡I" by blast
4268  also AOT_have   x ([F]x &  ¬[F]x)
4269    by (AOT_subst λκ. «([F]κ & ¬[F]κ)»  λ κ .  «[F]κ &  ¬[F]κ»)
4270       (auto simp: "S5Basic:11" "cqt-further:7")
4271  also AOT_have   x (¬[F]x & [F]x)
4272    by (AOT_subst λκ. «¬[F]κ & [F]κ»  λ κ .  «[F]κ & ¬[F]κ»)
4273       (auto simp: "Commutativity of &" "cqt-further:7")
4274  also AOT_have   x (¬[F]x & [F]x)
4275    by (AOT_subst λ κ .  «(¬[F]κ & [F]κ)» λκ. «¬[F]κ & [F]κ»)
4276       (auto simp: "S5Basic:11" "oth-class-taut:3:a")
4277  also AOT_have   x (¬[F]x & [F]x)
4278    using "BF◇" "CBF◇" "≡I" by fast
4279  finally show ?thesis.
4280qed
4281
4282AOT_theorem "lem-cont-e:2": x ([F]x & ¬[F]x)  x ([F]-x & ¬[F]-x)
4283proof -
4284  AOT_have x ([F]x & ¬[F]x)  x (¬[F]x & [F]x)
4285    using "lem-cont-e:1".
4286  also AOT_have   x ([F]-x & ¬[F]-x)
4287    apply (AOT_subst "λ κ . «¬[F]-κ»" "λ κ . «[F]κ»")
4288     apply (simp add: "thm-relation-negation:2")
4289    apply (AOT_subst "λ κ . «[F]-κ»" "λ κ . «¬[F]κ»")
4290     apply (simp add: "thm-relation-negation:1")
4291    by (simp add: "oth-class-taut:3:a")
4292  finally show ?thesis.
4293qed
4294
4295AOT_theorem "thm-cont-e:1": x (E!x & ¬E!x)
4296proof (rule "CBF◇"[THEN "→E"])
4297  AOT_have x (E!x & ¬𝒜E!x) using "qml:4"[axiom_inst] "BF◇"[THEN "→E"] by blast
4298  then AOT_obtain a where (E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
4299  AOT_hence θ: E!a & ¬𝒜E!a
4300    using "KBasic2:3"[THEN "→E"] by blast
4301  AOT_have ξ: E!a & 𝒜¬E!a
4302    by (AOT_subst  "«𝒜¬E!a»" "«¬𝒜E!a»")
4303       (auto simp: "logic-actual-nec:1"[axiom_inst] θ)
4304  AOT_have ζ: E!a & 𝒜¬E!a
4305    by (AOT_subst "«𝒜¬E!a»" "«𝒜¬E!a»")
4306       (auto simp add: "Act-Sub:4" ξ)
4307  AOT_hence E!a & ¬E!a
4308    using "&E" "&I" "Act-Sub:3"[THEN "→E"] by blast
4309  AOT_hence (E!a & ¬E!a) using "S5Basic:11"[THEN "≡E"(2)] by simp
4310  AOT_thus x (E!x & ¬E!x) using "∃I"(2) by fast
4311qed
4312
4313AOT_theorem "thm-cont-e:2": x (¬E!x & E!x)
4314proof -
4315  AOT_have F (x ([F]x & ¬[F]x)  x (¬[F]x & [F]x))
4316    using "lem-cont-e:1" GEN by fast
4317  AOT_hence (x (E!x & ¬E!x)  x (¬E!x & E!x))
4318    using "∀E"(1) "cqt:2[concrete]"[axiom_inst] by blast
4319  thus ?thesis using "thm-cont-e:1" "≡E" by blast
4320qed
4321
4322AOT_theorem "thm-cont-e:3": x E!x
4323proof (rule "CBF◇"[THEN "→E"])
4324  AOT_obtain a where (E!a & ¬E!a)
4325    using "∃E"[rotated, OF "thm-cont-e:1"[THEN "BF◇"[THEN "→E"]]] by blast
4326  AOT_hence E!a
4327    using "KBasic2:3"[THEN "→E", THEN "&E"(1)] by blast
4328  AOT_thus x E!x using "∃I" by fast
4329qed
4330
4331AOT_theorem "thm-cont-e:4": x ¬E!x
4332proof (rule "CBF◇"[THEN "→E"])
4333  AOT_obtain a where (E!a & ¬E!a)
4334    using "∃E"[rotated, OF "thm-cont-e:1"[THEN "BF◇"[THEN "→E"]]] by blast
4335  AOT_hence ¬E!a
4336    using "KBasic2:3"[THEN "→E", THEN "&E"(2)] by blast
4337  AOT_hence ¬E!a
4338    using "4◇"[THEN "→E"] by blast
4339  AOT_thus x ¬E!x using "∃I" by fast
4340qed
4341
4342AOT_theorem "thm-cont-e:5": Contingent([E!])
4343proof -
4344  AOT_have F (Contingent([F])  x [F]x & x ¬[F]x)
4345    using "thm-cont-prop:2" GEN by fast
4346  AOT_hence Contingent([E!])  x E!x & x ¬E!x
4347    using "∀E"(1) "cqt:2[concrete]"[axiom_inst] by blast
4348  thus ?thesis
4349    using "thm-cont-e:3" "thm-cont-e:4" "≡E"(2) "&I" by blast
4350qed
4351
4352AOT_theorem "thm-cont-e:6": Contingent([E!]-)
4353proof -
4354  AOT_have F (Contingent([«F::<κ>»])  Contingent([F]-))
4355    using "thm-cont-prop:3" GEN by fast
4356  AOT_hence Contingent([E!])  Contingent([E!]-)
4357    using "∀E" "cqt:2[concrete]"[axiom_inst] by fast
4358  thus ?thesis using "thm-cont-e:5" "≡E" by blast
4359qed
4360
4361AOT_theorem "thm-cont-e:7": FG (Contingent([«F::<κ>»]) & Contingent([G]) & F  G)
4362proof (rule "∃I")+
4363  AOT_have F [«F::<κ>»]  [F]- using "thm-relation-negation:5" GEN by fast
4364  AOT_hence [E!]  [E!]-
4365    using "∀E" "cqt:2[concrete]"[axiom_inst] by fast
4366  AOT_thus Contingent([E!]) & Contingent([E!]-) & [E!]  [E!]-
4367    using "thm-cont-e:5" "thm-cont-e:6" "&I" by metis
4368next
4369  AOT_show E!-
4370    by (fact AOT)
4371next
4372  AOT_show E! by (fact "cqt:2[concrete]"[axiom_inst])
4373qed
4374
4375AOT_theorem "property-facts:1": NonContingent([F])  ¬G (Contingent([G]) & G = F)
4376proof (rule "→I"; rule "raa-cor:2")
4377  AOT_assume NonContingent([F])
4378  AOT_hence 1: Necessary([F])  Impossible([F])
4379    using "contingent-properties:3"[THEN "≡dfE"] by blast
4380  AOT_assume G (Contingent([G]) & G = F)
4381  then AOT_obtain G where Contingent([G]) & G = F using "∃E"[rotated] by blast
4382  AOT_hence Contingent([F]) using "rule=E" "&E" by blast
4383  AOT_hence ¬(Necessary([F])  Impossible([F]))
4384    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)] by blast
4385  AOT_thus (Necessary([F])  Impossible([F])) & ¬(Necessary([F])  Impossible([F]))
4386    using 1 "&I" by blast
4387qed
4388
4389AOT_theorem "property-facts:2": Contingent([F])  ¬G (NonContingent([G]) & G = F)
4390proof (rule "→I"; rule "raa-cor:2")
4391  AOT_assume Contingent([F])
4392  AOT_hence 1: ¬(Necessary([F])  Impossible([F]))
4393    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)] by blast
4394  AOT_assume G (NonContingent([G]) & G = F)
4395  then AOT_obtain G where NonContingent([G]) & G = F using "∃E"[rotated] by blast
4396  AOT_hence NonContingent([F]) using "rule=E" "&E" by blast
4397  AOT_hence Necessary([F])  Impossible([F])
4398    using "contingent-properties:3"[THEN "≡dfE"] by blast
4399  AOT_thus (Necessary([F])  Impossible([F])) & ¬(Necessary([F])  Impossible([F]))
4400    using 1 "&I" by blast
4401qed
4402
4403AOT_theorem "property-facts:3": L  [L]- & L  E! & L  E!- & [L]-  [E!]- & E!  [E!]-
4404proof -
4405  AOT_have noneqI: Π  Π' if φ{Π} and ¬φ{Π'} for φ Π Π'
4406    apply (rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
4407    using "rule=E"[where φ=φ and τ=Π and σ = Π'] that "&I" by blast
4408  AOT_have contingent_denotes: Π if Contingent([Π]) for Π
4409    using that "contingent-properties:4"[THEN "≡dfE", THEN "&E"(1)] by blast
4410  AOT_have not_noncontingent_if_contingent: ¬NonContingent([Π]) if Contingent([Π]) for Π
4411  proof(rule RAA(2))
4412    AOT_show ¬(Necessary([Π])  Impossible([Π]))
4413      using that "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF contingent_denotes[OF that], THEN "≡E"(1)] by blast
4414  next
4415    AOT_assume NonContingent([Π])
4416    AOT_thus Necessary([Π])  Impossible([Π])
4417      using "contingent-properties:3"[THEN "≡dfE"] by blast
4418  qed
4419
4420  show ?thesis
4421  proof (rule "&I")+
4422    AOT_show L  [L]-
4423      apply (rule "=dfI"(2)[OF L_def])
4424       apply "cqt:2[lambda]"
4425      apply (rule "∀E"(1)[where φ="λ Π . «Π  [Π]-»"])
4426       apply (rule GEN) apply (fact AOT)
4427      by "cqt:2[lambda]"
4428  next
4429    AOT_show L  E!
4430      apply (rule noneqI)
4431      using "thm-noncont-e-e:3" not_noncontingent_if_contingent[OF "thm-cont-e:5"]
4432      by auto
4433  next
4434    AOT_show L  E!-
4435      apply (rule noneqI)
4436      using "thm-noncont-e-e:3" apply fast
4437      apply (rule not_noncontingent_if_contingent)
4438      apply (rule "∀E"(1)[where φ="λ Π . «Contingent([Π])  Contingent([Π]-)»", rotated, OF contingent_denotes, THEN "≡E"(1), rotated])
4439      using "thm-cont-prop:3" GEN apply fast
4440      using "thm-cont-e:5" by fast+
4441  next
4442    AOT_show [L]-  E!-
4443      apply (rule noneqI)
4444      using "thm-noncont-e-e:4" apply fast
4445      apply (rule not_noncontingent_if_contingent)
4446      apply (rule "∀E"(1)[where φ="λ Π . «Contingent([Π])  Contingent([Π]-)»", rotated, OF contingent_denotes, THEN "≡E"(1), rotated])
4447      using "thm-cont-prop:3" GEN apply fast
4448      using "thm-cont-e:5" by fast+
4449  next
4450    AOT_show E!  E!-
4451      apply (rule "=dfI"(2)[OF L_def])
4452       apply "cqt:2[lambda]"
4453      apply (rule "∀E"(1)[where φ="λ Π . «Π  [Π]-»"])
4454       apply (rule GEN) apply (fact AOT)
4455      by (fact "cqt:2[concrete]"[axiom_inst])
4456  qed
4457qed
4458
4459AOT_theorem "thm-cont-propos:1": NonContingent0(p)  NonContingent0(((p)-))
4460proof(rule "≡I"; rule "→I")
4461  AOT_assume NonContingent0(p)
4462  AOT_hence Necessary0(p)  Impossible0(p)
4463    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4464  moreover {
4465    AOT_assume Necessary0(p)
4466    AOT_hence 1: p using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4467    AOT_have ¬((p)-)
4468      by (AOT_subst "«¬((p)-)»" "AOT_term_of_var p")
4469         (auto simp add: 1 "thm-relation-negation:4")
4470    AOT_hence Impossible0(((p)-))
4471      by (rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4472  }
4473  moreover {
4474    AOT_assume Impossible0(p)
4475    AOT_hence 1: ¬p
4476      by (rule "contingent-properties:2[zero]"[THEN "≡dfE"])
4477    AOT_have ((p)-)
4478      by (AOT_subst "«((p)-)»" "«¬p»") 
4479         (auto simp: 1 "thm-relation-negation:3")
4480    AOT_hence Necessary0(((p)-))
4481      by (rule "contingent-properties:1[zero]"[THEN "≡dfI"])
4482  }
4483  ultimately AOT_have Necessary0(((p)-))  Impossible0(((p)-))
4484    using "∨E"(1) "∨I" "→I" by metis
4485  AOT_thus NonContingent0(((p)-))
4486    using "contingent-properties:3[zero]"[THEN "≡dfI"] by blast
4487next
4488  AOT_assume NonContingent0(((p)-))
4489  AOT_hence Necessary0(((p)-))  Impossible0(((p)-))
4490    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4491  moreover {
4492    AOT_assume Impossible0(((p)-))
4493    AOT_hence 1: ¬((p)-)
4494      by (rule "contingent-properties:2[zero]"[THEN "≡dfE"])
4495    AOT_have p
4496      by (AOT_subst_rev "«¬((p)-)»" "AOT_term_of_var p")
4497         (auto simp: 1 "thm-relation-negation:4")
4498    AOT_hence Necessary0(p)
4499      using "contingent-properties:1[zero]"[THEN "≡dfI"] by blast
4500  }
4501  moreover {
4502    AOT_assume Necessary0(((p)-))
4503    AOT_hence 1: ((p)-)
4504      by (rule "contingent-properties:1[zero]"[THEN "≡dfE"])
4505    AOT_have ¬p
4506      by (AOT_subst_rev "«((p)-)»" "«¬p»")
4507         (auto simp: 1 "thm-relation-negation:3")
4508    AOT_hence Impossible0(p)
4509      by (rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4510  }
4511  ultimately AOT_have Necessary0(p)  Impossible0(p)
4512    using "∨E"(1) "∨I" "→I" by metis
4513  AOT_thus NonContingent0(p)
4514    using "contingent-properties:3[zero]"[THEN "≡dfI"] by blast
4515qed
4516
4517AOT_theorem "thm-cont-propos:2": Contingent0(φ)  φ & ¬φ
4518proof -
4519  AOT_have Contingent0(φ)  ¬(Necessary0(φ)  Impossible0(φ))
4520    using "contingent-properties:4[zero]"[THEN "≡Df"] by simp
4521  also AOT_have   ¬Necessary0(φ) & ¬Impossible0(φ)
4522    by (fact AOT)
4523  also AOT_have   ¬Impossible0(φ) & ¬Necessary0(φ)
4524    by (fact AOT)
4525  also AOT_have   φ & ¬φ
4526    apply (AOT_subst "«φ»" "«¬¬φ»")
4527     apply (simp add: "conventions:5" "≡Df")
4528    apply (AOT_subst "«Impossible0(φ)»" "«¬φ»")
4529     apply (simp add: "contingent-properties:2[zero]" "≡Df")
4530    apply (AOT_subst_rev "«¬φ»" "«¬φ»")
4531     apply (simp add: "KBasic:11")
4532    apply (AOT_subst "«Necessary0(φ)»" "«φ»")
4533     apply (simp add: "contingent-properties:1[zero]" "≡Df")
4534    by (simp add: "oth-class-taut:3:a")
4535  finally show ?thesis.
4536qed
4537
4538AOT_theorem "thm-cont-propos:3": Contingent0(p)  Contingent0(((p)-))
4539proof -
4540  AOT_have Contingent0(p)  p & ¬p using "thm-cont-propos:2".
4541  also AOT_have   ¬p & p by (fact AOT)
4542  also AOT_have   ((p)-) & p
4543    by (AOT_subst "«((p)-)»" "«¬p»")
4544       (auto simp: "thm-relation-negation:3" "oth-class-taut:3:a")
4545  also AOT_have   ((p)-) & ¬((p)-)
4546    by (AOT_subst "«¬((p)-)»" "AOT_term_of_var p")
4547       (auto simp: "thm-relation-negation:4" "oth-class-taut:3:a")
4548  also AOT_have   Contingent0(((p)-))
4549    using "thm-cont-propos:2"[symmetric] by blast
4550  finally show ?thesis.
4551qed
4552
4553AOT_define noncontingent_prop :: ‹φ› ("p0")
4554  p0_def: "(p0) =df (x (E!x  E!x))"
4555
4556AOT_theorem "thm-noncont-propos:1":  Necessary0((p0))
4557proof(rule "contingent-properties:1[zero]"[THEN "≡dfI"])
4558  AOT_show (p0)
4559    apply (rule "=dfI"(2)[OF p0_def])
4560    using "log-prop-prop:2" apply simp
4561    using "if-p-then-p" RN GEN by fast
4562qed
4563
4564AOT_theorem "thm-noncont-propos:2": Impossible0(((p0)-))
4565proof(rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4566  AOT_show ¬((p0)-)
4567    apply (AOT_subst "«((p0)-)»" "«¬p0»")
4568    using "thm-relation-negation:3" GEN "∀E"(1)[rotated, OF "log-prop-prop:2"] apply fast
4569    apply (AOT_subst_rev "«p0»" "«¬¬p0»" )
4570     apply (simp add: "oth-class-taut:3:b")
4571    apply (rule "=dfI"(2)[OF p0_def])
4572    using "log-prop-prop:2" apply simp
4573    using "if-p-then-p" RN GEN by fast
4574qed
4575
4576AOT_theorem "thm-noncont-propos:3": NonContingent0((p0))
4577  apply(rule "contingent-properties:3[zero]"[THEN "≡dfI"])
4578  using "thm-noncont-propos:1" "∨I" by blast
4579
4580AOT_theorem "thm-noncont-propos:4": NonContingent0(((p0)-))
4581  apply(rule "contingent-properties:3[zero]"[THEN "≡dfI"])
4582  using "thm-noncont-propos:2" "∨I" by blast
4583
4584AOT_theorem "thm-noncont-propos:5": pq (NonContingent0((p)) & NonContingent0((q)) & p  q)
4585proof(rule "∃I")+
4586  AOT_have 0: φ  (φ)- for φ
4587    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4588  AOT_thus NonContingent0((p0)) & NonContingent0(((p0)-)) & (p0)  (p0)-
4589    using "thm-noncont-propos:3" "thm-noncont-propos:4" "&I" by auto
4590qed(auto simp: "log-prop-prop:2")
4591
4592AOT_act_theorem "no-cnac": ¬x(E!x & ¬𝒜E!x)
4593proof(rule "raa-cor:2")
4594  AOT_assume x(E!x & ¬𝒜E!x)
4595  then AOT_obtain a where a: E!a & ¬𝒜E!a
4596    using "∃E"[rotated] by blast
4597  AOT_hence 𝒜¬E!a using "&E" "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
4598  AOT_hence ¬E!a using "logic-actual"[act_axiom_inst, THEN "→E"] by blast
4599  AOT_hence E!a & ¬E!a using a "&E" "&I" by blast
4600  AOT_thus p & ¬p for p using "raa-cor:1" by blast
4601qed
4602
4603AOT_theorem "pos-not-pna:1": ¬𝒜x (E!x & ¬𝒜E!x)
4604proof(rule "raa-cor:2")
4605  AOT_assume 𝒜x (E!x & ¬𝒜E!x)
4606  AOT_hence x 𝒜(E!x & ¬𝒜E!x)
4607    using "Act-Basic:10"[THEN "≡E"(1)] by blast
4608  then AOT_obtain a where 𝒜(E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
4609  AOT_hence 1: 𝒜E!a & 𝒜¬𝒜E!a using "Act-Basic:2"[THEN "≡E"(1)] by blast
4610  AOT_hence ¬𝒜𝒜E!a using "&E"(2) "logic-actual-nec:1"[axiom_inst, THEN "≡E"(1)] by blast
4611  AOT_hence ¬𝒜E!a using "logic-actual-nec:4"[axiom_inst, THEN "≡E"(1)] RAA by blast
4612  AOT_thus p & ¬p for p using 1[THEN "&E"(1)] "&I" "raa-cor:1" by blast
4613qed
4614
4615AOT_theorem "pos-not-pna:2": ¬x(E!x & ¬𝒜E!x)
4616proof (rule RAA(1))
4617  AOT_show ¬𝒜x (E!x & ¬𝒜E!x) using "pos-not-pna:1" by blast
4618next
4619  AOT_assume ¬¬x (E!x & ¬𝒜E!x)
4620  AOT_hence x (E!x & ¬𝒜E!x)
4621    using "KBasic:12"[THEN "≡E"(2)] by blast
4622  AOT_thus 𝒜x (E!x & ¬𝒜E!x)
4623    using "nec-imp-act"[THEN "→E"] by blast
4624qed
4625
4626AOT_theorem "pos-not-pna:3": x (E!x & ¬𝒜E!x)
4627proof -
4628  AOT_obtain a where (E!a & ¬𝒜E!a)
4629    using "qml:4"[axiom_inst] "BF◇"[THEN "→E"] "∃E"[rotated] by blast
4630  AOT_hence θ: E!a and ξ: ¬𝒜E!a using "KBasic2:3"[THEN "→E"] "&E" by blast+
4631  AOT_have ¬𝒜E!a using ξ "KBasic:11"[THEN "≡E"(2)] by blast
4632  AOT_hence ¬𝒜E!a using "Act-Basic:6"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)] by blast
4633  AOT_hence E!a & ¬𝒜E!a using θ "&I" by blast
4634  thus ?thesis using "∃I" by fast
4635qed
4636
4637AOT_define contingent_prop :: φ ("q0")
4638  q0_def: (q0) =df (x (E!x & ¬𝒜E!x))
4639
4640AOT_theorem q0_prop: q0 & ¬q0
4641  apply (rule "=dfI"(2)[OF q0_def])
4642  apply (fact "log-prop-prop:2")
4643  apply (rule "&I")
4644   apply (fact "qml:4"[axiom_inst])
4645  by (fact "pos-not-pna:2")
4646
4647AOT_theorem "basic-prop:1": Contingent0((q0))
4648proof(rule "contingent-properties:4[zero]"[THEN "≡dfI"])
4649  AOT_have ¬Necessary0((q0)) & ¬Impossible0((q0))
4650  proof (rule "&I"; rule "=dfI"(2)[OF q0_def]; (rule "log-prop-prop:2" | rule "raa-cor:2"))
4651    AOT_assume Necessary0(x (E!x & ¬𝒜E!x))
4652    AOT_hence x (E!x & ¬𝒜E!x)
4653      using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4654    AOT_hence 𝒜x (E!x & ¬𝒜E!x)
4655      using "Act-Basic:8"[THEN "→E"] "qml:2"[axiom_inst, THEN "→E"] by blast
4656    AOT_thus 𝒜x (E!x & ¬𝒜E!x) & ¬𝒜x (E!x & ¬𝒜E!x)
4657      using "pos-not-pna:1" "&I" by blast
4658  next
4659    AOT_assume Impossible0(x (E!x & ¬𝒜E!x))
4660    AOT_hence ¬(x (E!x & ¬𝒜E!x))
4661      using "contingent-properties:2[zero]"[THEN "≡dfE"] by blast
4662    AOT_hence ¬(x (E!x & ¬𝒜E!x)) using "KBasic2:1"[THEN "≡E"(1)] by blast
4663    AOT_thus (x (E!x & ¬𝒜E!x)) & ¬(x (E!x & ¬𝒜E!x))
4664      using "qml:4"[axiom_inst] "&I" by blast
4665  qed
4666  AOT_thus ¬(Necessary0((q0))  Impossible0((q0)))
4667    using "oth-class-taut:5:d" "≡E"(2) by blast
4668qed
4669
4670AOT_theorem "basic-prop:2": p Contingent0((p))
4671  using "∃I"(1)[rotated, OF "log-prop-prop:2"] "basic-prop:1" by blast
4672
4673AOT_theorem "basic-prop:3": Contingent0(((q0)-))
4674  apply (AOT_subst "«(q0)-»" "«¬q0»")
4675   apply (insert "thm-relation-negation:3" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"]; fast)
4676  apply (rule "contingent-properties:4[zero]"[THEN "≡dfI"])
4677  apply (rule "oth-class-taut:5:d"[THEN "≡E"(2)])
4678  apply (rule "&I")
4679   apply (rule "contingent-properties:1[zero]"[THEN "df-rules-formulas[3]", THEN "useful-tautologies:5"[THEN "→E"], THEN "→E"])
4680   apply (rule "conventions:5"[THEN "≡dfE"])
4681   apply (rule "=dfE"(2)[OF q0_def])
4682    apply (rule "log-prop-prop:2")
4683   apply (rule q0_prop[THEN "&E"(1)])
4684  apply (rule "contingent-properties:2[zero]"[THEN "df-rules-formulas[3]", THEN "useful-tautologies:5"[THEN "→E"], THEN "→E"])
4685  apply (rule "conventions:5"[THEN "≡dfE"])
4686  by (rule q0_prop[THEN "&E"(2)])
4687
4688AOT_theorem "basic-prop:4": pq (p  q & Contingent0(p) & Contingent0(q))
4689proof(rule "∃I")+
4690  AOT_have 0: φ  (φ)- for φ
4691    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4692  AOT_show (q0)  (q0)- & Contingent0(q0) & Contingent0(((q0)-))
4693    using "basic-prop:1" "basic-prop:3" "&I" 0 by presburger
4694qed(auto simp: "log-prop-prop:2")
4695
4696AOT_theorem "proposition-facts:1": NonContingent0(p)  ¬q (Contingent0(q) & q = p)
4697proof(rule "→I"; rule "raa-cor:2")
4698  AOT_assume NonContingent0(p)
4699  AOT_hence 1: Necessary0(p)  Impossible0(p)
4700    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4701  AOT_assume q (Contingent0(q) & q = p)
4702  then AOT_obtain q where Contingent0(q) & q = p using "∃E"[rotated] by blast
4703  AOT_hence Contingent0(p) using "rule=E" "&E" by fast
4704  AOT_thus (Necessary0(p)  Impossible0(p)) & ¬(Necessary0(p)  Impossible0(p))
4705    using "contingent-properties:4[zero]"[THEN "≡dfE"] 1 "&I" by blast
4706qed
4707
4708AOT_theorem "proposition-facts:2": Contingent0(p)  ¬q (NonContingent0(q) & q = p)
4709proof(rule "→I"; rule "raa-cor:2")
4710  AOT_assume Contingent0(p)
4711  AOT_hence 1: ¬(Necessary0(p)  Impossible0(p))
4712    using "contingent-properties:4[zero]"[THEN "≡dfE"] by blast
4713  AOT_assume q (NonContingent0(q) & q = p)
4714  then AOT_obtain q where NonContingent0(q) & q = p using "∃E"[rotated] by blast
4715  AOT_hence NonContingent0(p) using "rule=E" "&E" by fast
4716  AOT_thus (Necessary0(p)  Impossible0(p)) & ¬(Necessary0(p)  Impossible0(p))
4717    using "contingent-properties:3[zero]"[THEN "≡dfE"] 1 "&I" by blast
4718qed
4719
4720AOT_theorem "proposition-facts:3": (p0)  (p0)- & (p0)  (q0) & (p0)  (q0)- & (p0)-  (q0)- & (q0)  (q0)-
4721proof -
4722  {
4723    fix χ φ ψ
4724    AOT_assume χ{φ}
4725    moreover AOT_assume ¬χ{ψ}
4726    ultimately AOT_have ¬(χ{φ}  χ{ψ})
4727      using RAA "≡E" by metis
4728    moreover {
4729      AOT_have pq ((¬(χ{p}  χ{q}))  p  q)
4730        by (rule "∀I"; rule "∀I"; rule "pos-not-equiv-ne:4[zero]")
4731      AOT_hence ((¬(χ{φ}  χ{ψ}))  φ  ψ)
4732        using "∀E" "log-prop-prop:2" by blast
4733    }
4734    ultimately AOT_have φ  ψ
4735      using "→E" by blast
4736  } note 0 = this
4737  AOT_have contingent_neg: Contingent0(φ)  Contingent0(((φ)-)) for φ
4738    using "thm-cont-propos:3" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4739  AOT_have not_noncontingent_if_contingent: ¬NonContingent0(φ) if Contingent0(φ) for φ
4740    apply (rule "contingent-properties:3[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4741    using that "contingent-properties:4[zero]"[THEN "≡dfE"] by blast
4742  show ?thesis
4743    apply (rule "&I")+
4744    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] apply fast
4745       apply (rule 0)
4746    using "thm-noncont-propos:3" apply fast
4747       apply (rule not_noncontingent_if_contingent)
4748       apply (fact AOT)
4749      apply (rule 0)
4750    apply (rule "thm-noncont-propos:3")
4751      apply (rule not_noncontingent_if_contingent)
4752      apply (rule contingent_neg[THEN "≡E"(1)])
4753      apply (fact AOT)
4754     apply (rule 0)
4755    apply (rule "thm-noncont-propos:4")
4756      apply (rule not_noncontingent_if_contingent)
4757      apply (rule contingent_neg[THEN "≡E"(1)])
4758     apply (fact AOT)
4759    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4760qed
4761
4762AOT_define "cont-tf:1" :: ‹φ  φ› ("ContingentlyTrue'(_')")
4763  "cont-tf:1": ContingentlyTrue(p) df p & ¬p
4764
4765AOT_define "cont-tf:2" :: ‹φ  φ› ("ContingentlyFalse'(_')")
4766  "cont-tf:2": ContingentlyFalse(p) df ¬p & p
4767
4768AOT_theorem "cont-true-cont:1": ContingentlyTrue((p))  Contingent0((p))
4769proof(rule "→I")
4770  AOT_assume ContingentlyTrue((p))
4771  AOT_hence 1: p and 2: ¬p using "cont-tf:1"[THEN "≡dfE"] "&E" by blast+
4772  AOT_have ¬Necessary0((p))
4773    apply (rule "contingent-properties:1[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4774    using 2 "KBasic:11"[THEN "≡E"(2)] by blast
4775  moreover AOT_have ¬Impossible0((p))
4776    apply (rule "contingent-properties:2[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4777    apply (rule "conventions:5"[THEN "≡dfE"])
4778    using "T◇"[THEN "→E", OF 1].
4779  ultimately AOT_have ¬(Necessary0((p))  Impossible0((p)))
4780    using DeMorgan(2)[THEN "≡E"(2)] "&I" by blast
4781  AOT_thus Contingent0((p))
4782    using "contingent-properties:4[zero]"[THEN "≡dfI"] by blast
4783qed
4784
4785AOT_theorem "cont-true-cont:2": ContingentlyFalse((p))  Contingent0((p))
4786proof(rule "→I")
4787  AOT_assume ContingentlyFalse((p))
4788  AOT_hence 1: ¬p and 2: p using "cont-tf:2"[THEN "≡dfE"] "&E" by blast+
4789  AOT_have ¬Necessary0((p))
4790    apply (rule "contingent-properties:1[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4791    using "KBasic:11"[THEN "≡E"(2)] "T◇"[THEN "→E", OF 1] by blast
4792  moreover AOT_have ¬Impossible0((p))
4793    apply (rule "contingent-properties:2[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4794    apply (rule "conventions:5"[THEN "≡dfE"])
4795    using 2.
4796  ultimately AOT_have ¬(Necessary0((p))  Impossible0((p)))
4797    using DeMorgan(2)[THEN "≡E"(2)] "&I" by blast
4798  AOT_thus Contingent0((p))
4799    using "contingent-properties:4[zero]"[THEN "≡dfI"] by blast
4800qed
4801
4802AOT_theorem "cont-true-cont:3": ContingentlyTrue((p))  ContingentlyFalse(((p)-))
4803proof(rule "≡I"; rule "→I")
4804  AOT_assume ContingentlyTrue((p))
4805  AOT_hence 0: p & ¬p using "cont-tf:1"[THEN "≡dfE"] by blast
4806  AOT_have 1: ContingentlyFalse(¬p)
4807    apply (rule "cont-tf:2"[THEN "≡dfI"])
4808    apply (AOT_subst_rev "AOT_term_of_var p" "«¬¬p»")
4809    by (auto simp: "oth-class-taut:3:b" 0)
4810  AOT_show ContingentlyFalse(((p)-))
4811    apply (AOT_subst "«(p)-»" "«¬p»")
4812    by (auto simp: "thm-relation-negation:3" 1)
4813next
4814  AOT_assume 1: ContingentlyFalse(((p)-))
4815  AOT_have ContingentlyFalse(¬p)
4816    by (AOT_subst_rev "«(p)-»" "«¬p»")
4817       (auto simp: "thm-relation-negation:3" 1)
4818  AOT_hence ¬¬p & ¬p using "cont-tf:2"[THEN "≡dfE"] by blast
4819  AOT_hence p & ¬p
4820    using "&I" "&E" "useful-tautologies:1"[THEN "→E"] by metis
4821  AOT_thus ContingentlyTrue((p))
4822    using "cont-tf:1"[THEN "≡dfI"] by blast
4823qed
4824
4825AOT_theorem "cont-true-cont:4": ContingentlyFalse((p))  ContingentlyTrue(((p)-))
4826proof(rule "≡I"; rule "→I")
4827  AOT_assume ContingentlyFalse(p)
4828  AOT_hence 0: ¬p & p
4829    using "cont-tf:2"[THEN "≡dfE"] by blast
4830  AOT_have ¬p & ¬¬p
4831    by (AOT_subst_rev "AOT_term_of_var p" "«¬¬p»")
4832       (auto simp: "oth-class-taut:3:b" 0)
4833  AOT_hence 1: ContingentlyTrue(¬p)
4834    by (rule "cont-tf:1"[THEN "≡dfI"])
4835  AOT_show ContingentlyTrue(((p)-))
4836    by (AOT_subst "«(p)-»" "«¬p»")
4837       (auto simp: "thm-relation-negation:3" 1)
4838next
4839  AOT_assume 1: ContingentlyTrue(((p)-))
4840  AOT_have ContingentlyTrue(¬p)
4841    by (AOT_subst_rev "«(p)-»" "«¬p»")
4842       (auto simp add: "thm-relation-negation:3" 1)
4843  AOT_hence 2: ¬p & ¬¬p using "cont-tf:1"[THEN "≡dfE"] by blast
4844  AOT_have p
4845    by (AOT_subst "AOT_term_of_var p" "«¬¬p»")
4846       (auto simp add: "oth-class-taut:3:b" 2[THEN "&E"(2)])
4847  AOT_hence ¬p & p using 2[THEN "&E"(1)] "&I" by blast
4848  AOT_thus ContingentlyFalse(p)
4849    by (rule "cont-tf:2"[THEN "≡dfI"])
4850qed
4851
4852AOT_theorem "cont-true-cont:5": (ContingentlyTrue((p)) & Necessary0((q)))  p  q
4853proof (rule "→I"; frule "&E"(1); drule "&E"(2); rule "raa-cor:1")
4854  AOT_assume ContingentlyTrue((p))
4855  AOT_hence ¬p
4856    using "cont-tf:1"[THEN "≡dfE"] "&E" by blast
4857  AOT_hence 0: ¬p using "KBasic:11"[THEN "≡E"(2)] by blast
4858  AOT_assume Necessary0((q))
4859  moreover AOT_assume ¬(p  q)
4860  AOT_hence p = q
4861    using "=-infix"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4862          "useful-tautologies:1"[THEN "→E"] by blast
4863  ultimately AOT_have Necessary0((p)) using "rule=E" id_sym by blast
4864  AOT_hence p
4865    using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4866  AOT_thus p & ¬p using 0 "&I" by blast
4867qed
4868
4869AOT_theorem "cont-true-cont:6": (ContingentlyFalse((p)) & Impossible0((q)))  p  q
4870proof (rule "→I"; frule "&E"(1); drule "&E"(2); rule "raa-cor:1")
4871  AOT_assume ContingentlyFalse((p))
4872  AOT_hence p
4873    using "cont-tf:2"[THEN "≡dfE"] "&E" by blast
4874  AOT_hence 1: ¬¬p
4875    using "conventions:5"[THEN "≡dfE"] by blast
4876  AOT_assume Impossible0((q))
4877  moreover AOT_assume ¬(p  q)
4878  AOT_hence p = q
4879    using "=-infix"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4880          "useful-tautologies:1"[THEN "→E"] by blast
4881  ultimately AOT_have Impossible0((p)) using "rule=E" id_sym by blast
4882  AOT_hence ¬p
4883    using "contingent-properties:2[zero]"[THEN "≡dfE"] by blast
4884  AOT_thus ¬p & ¬¬p using 1 "&I" by blast
4885qed
4886
4887AOT_act_theorem "q0cf:1": ContingentlyFalse(q0)
4888  apply (rule "cont-tf:2"[THEN "≡dfI"])
4889  apply (rule "=dfI"(2)[OF q0_def])
4890   apply (fact "log-prop-prop:2")
4891  apply (rule "&I")
4892   apply (fact "no-cnac")
4893  by (fact "qml:4"[axiom_inst])
4894
4895AOT_act_theorem "q0cf:2": ContingentlyTrue(((q0)-))
4896  apply (rule "cont-tf:1"[THEN "≡dfI"])
4897  apply (rule "=dfI"(2)[OF q0_def])
4898   apply (fact "log-prop-prop:2")
4899  apply (rule "&I")
4900     apply (rule "thm-relation-negation:3"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(2)])
4901     apply (fact "no-cnac")
4902    apply (rule "rule=E"[rotated, OF "thm-relation-negation:7"[unvarify p, OF "log-prop-prop:2", THEN id_sym]])
4903  apply (AOT_subst_rev "«x (E!x & ¬𝒜E!x)»" "«¬¬(x  (E!x & ¬𝒜E!x))»")
4904  by (auto simp: "oth-class-taut:3:b" "qml:4"[axiom_inst])
4905
4906(* TODO: q0cf-rem skipped for now *)
4907
4908AOT_theorem "cont-tf-thm:1": p ContingentlyTrue((p))
4909proof(rule "∨E"(1)[OF "exc-mid"]; rule "→I"; rule "∃I")
4910  AOT_assume q0
4911  AOT_hence q0 & ¬q0 using q0_prop[THEN "&E"(2)] "&I" by blast
4912  AOT_thus ContingentlyTrue(q0)
4913    by (rule "cont-tf:1"[THEN "≡dfI"])
4914next
4915  AOT_assume ¬q0
4916  AOT_hence ¬q0 & q0 using q0_prop[THEN "&E"(1)] "&I" by blast
4917  AOT_hence ContingentlyFalse(q0)
4918    by (rule "cont-tf:2"[THEN "≡dfI"])
4919  AOT_thus ContingentlyTrue(((q0)-))
4920    by (rule "cont-true-cont:4"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(1)])
4921qed(auto simp: "log-prop-prop:2")
4922
4923
4924AOT_theorem "cont-tf-thm:2": p ContingentlyFalse((p))
4925proof(rule "∨E"(1)[OF "exc-mid"]; rule "→I"; rule "∃I")
4926  AOT_assume q0
4927  AOT_hence q0 & ¬q0 using q0_prop[THEN "&E"(2)] "&I" by blast
4928  AOT_hence ContingentlyTrue(q0)
4929    by (rule "cont-tf:1"[THEN "≡dfI"])
4930  AOT_thus ContingentlyFalse(((q0)-))
4931    by (rule "cont-true-cont:3"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(1)])
4932next
4933  AOT_assume ¬q0
4934  AOT_hence ¬q0 & q0 using q0_prop[THEN "&E"(1)] "&I" by blast
4935  AOT_thus ContingentlyFalse(q0)
4936    by (rule "cont-tf:2"[THEN "≡dfI"])
4937qed(auto simp: "log-prop-prop:2")
4938
4939(* TODO: inspect modally strict subproof involving obtained variable *)
4940AOT_theorem "property-facts1:1": Fx ([F]x & ¬[F]x)
4941proof -
4942  fix x
4943  AOT_obtain p1 where ContingentlyTrue((p1))
4944    using "cont-tf-thm:1" "∃E"[rotated] by blast
4945  AOT_hence 1: p1 & ¬p1 using "cont-tf:1"[THEN "≡dfE"] by blast
4946  AOT_modally_strict {
4947    AOT_have for arbitrary p:  (z p]x  p)
4948      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
4949    AOT_hence for arbitrary p:   (z p]x  p)
4950      by (rule RN)
4951    AOT_hence p (z p]x  p) using GEN by fast
4952    AOT_hence (z p1]x  p1) using "∀E" by fast
4953  } note 2 = this
4954  AOT_hence (z p1]x  p1) using "∀E" by blast
4955  AOT_hence z p1]x using 1[THEN "&E"(1)] "qml:2"[axiom_inst, THEN "→E"] "≡E"(2) by blast
4956  moreover AOT_have ¬z p1]x
4957    apply (AOT_subst_using subst: 2[THEN "qml:2"[axiom_inst, THEN "→E"]])
4958    using 1[THEN "&E"(2)] by blast
4959  ultimately AOT_have z p1]x & ¬z p1]x using "&I" by blast
4960  AOT_hence x (z p1]x & ¬z p1]x) using "∃I"(2) by fast
4961  moreover AOT_have z p1] by "cqt:2[lambda]"
4962  ultimately AOT_show Fx ([F]x & ¬[F]x) by (rule "∃I"(1))
4963qed
4964
4965(* TODO: inspect modally strict subproof involving obtained variable *)
4966AOT_theorem "property-facts1:2": Fx (¬[F]x & [F]x)
4967proof -
4968  fix x
4969  AOT_obtain p1 where ContingentlyFalse((p1))
4970    using "cont-tf-thm:2" "∃E"[rotated] by blast
4971  AOT_hence 1: ¬p1 & p1 using "cont-tf:2"[THEN "≡dfE"] by blast
4972  AOT_modally_strict {
4973    AOT_have for arbitrary p:  (z p]x  p)
4974      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
4975    AOT_hence for arbitrary p:  (¬z p]x  ¬p)
4976      using "oth-class-taut:4:b" "≡E" by blast
4977    AOT_hence for arbitrary p:  (¬z p]x  ¬p)
4978      by (rule RN)
4979    AOT_hence p (¬z p]x  ¬p) using GEN by fast
4980    AOT_hence (¬z p1]x  ¬p1) using "∀E" by fast
4981  } note 2 = this
4982  AOT_hence (¬z p1]x  ¬p1) using "∀E" by blast
4983  AOT_hence 3: ¬z p1]x using 1[THEN "&E"(1)] "qml:2"[axiom_inst, THEN "→E"] "≡E"(2) by blast
4984  AOT_modally_strict {
4985    AOT_have for arbitrary p:  (z p]x  p)
4986      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
4987    AOT_hence for arbitrary p:  (z p]x  p)
4988      by (rule RN)
4989    AOT_hence p (z p]x  p) using GEN by fast
4990    AOT_hence (z p1]x  p1) using "∀E" by fast
4991  } note 4 = this
4992  AOT_have z p1]x
4993    apply (AOT_subst_using subst: 4[THEN "qml:2"[axiom_inst, THEN "→E"]])
4994    using 1[THEN "&E"(2)] by blast
4995  AOT_hence ¬z p1]x & z p1]x using 3 "&I" by blast
4996  AOT_hence x (¬z p1]x & z p1]x) using "∃I"(2) by fast
4997  moreover AOT_have z p1] by "cqt:2[lambda]"
4998  ultimately AOT_show Fx (¬[F]x & [F]x) by (rule "∃I"(1))
4999qed
5000
5001context
5002begin
5003
5004private AOT_lemma eqnotnec_123_Aux_ζ: [L]x  (E!x  E!x)
5005    apply (rule "=dfI"(2)[OF L_def])
5006     apply "cqt:2[lambda]"
5007    apply (rule "beta-C-meta"[THEN "→E"])
5008  by "cqt:2[lambda]"
5009
5010private AOT_lemma eqnotnec_123_Aux_ω: z φ]x  φ
5011    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5012
5013private AOT_lemma eqnotnec_123_Aux_θ: φ  x([L]x  z φ]x)
5014proof(rule "≡I"; rule "→I"; (rule "∀I")?)
5015  fix x
5016  AOT_assume 1: φ
5017  AOT_have [L]x  (E!x  E!x) using eqnotnec_123_Aux_ζ.
5018  also AOT_have   φ
5019    using "if-p-then-p" 1 "≡I" "→I" by simp
5020  also AOT_have   z φ]x
5021    using "Commutativity of ≡"[THEN "≡E"(1)] eqnotnec_123_Aux_ω by blast
5022  finally AOT_show [L]x  z φ]x.
5023next
5024  fix x
5025  AOT_assume x([L]x  z φ]x)
5026  AOT_hence [L]x  z φ]x using "∀E" by blast
5027  also AOT_have   φ using eqnotnec_123_Aux_ω.
5028  finally AOT_have φ  [L]x using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5029  also AOT_have   E!x  E!x using eqnotnec_123_Aux_ζ.
5030  finally AOT_show φ using "≡E" "if-p-then-p" by fast
5031qed
5032private lemmas eqnotnec_123_Aux_ξ =  eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)],
5033                      THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)],
5034                      THEN "RM◇"]
5035private lemmas eqnotnec_123_Aux_ξ' = eqnotnec_123_Aux_θ[THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)], THEN "RM◇"]
5036
5037AOT_theorem "eqnotnec:1": FG(x([F]x  [G]x) & ¬x([F]x  [G]x))
5038proof-
5039  AOT_obtain p1 where ContingentlyTrue(p1) using "cont-tf-thm:1" "∃E"[rotated] by blast
5040  AOT_hence p1 & ¬p1 using "cont-tf:1"[THEN "≡dfE"] by blast
5041  AOT_hence x ([L]x  z p1]x) & ¬x([L]x  z p1]x)
5042    apply - apply (rule "&I")
5043    using "&E" eqnotnec_123_Aux_θ[THEN "≡E"(1)] eqnotnec_123_Aux_ξ "→E" by fast+
5044  AOT_hence G (x([L]x  [G]x) & ¬x([L]x  [G]x))
5045    by (rule "∃I") "cqt:2[lambda]"
5046  AOT_thus FG (x([F]x  [G]x) & ¬x([F]x  [G]x))
5047    apply (rule "∃I")
5048    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5049qed
5050
5051AOT_theorem "eqnotnec:2": FG(¬x([F]x  [G]x) & x([F]x  [G]x))
5052proof-
5053  AOT_obtain p1 where ContingentlyFalse(p1) using "cont-tf-thm:2" "∃E"[rotated] by blast
5054  AOT_hence ¬p1 & p1 using "cont-tf:2"[THEN "≡dfE"] by blast
5055  AOT_hence ¬x ([L]x  z p1]x) & x([L]x  z p1]x)
5056    apply - apply (rule "&I")
5057    using "&E" eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)] eqnotnec_123_Aux_ξ' "→E" by fast+
5058  AOT_hence G (¬x([L]x  [G]x) & x([L]x  [G]x))
5059    by (rule "∃I") "cqt:2[lambda]"
5060  AOT_thus FG (¬x([F]x  [G]x) & x([F]x  [G]x))
5061    apply (rule "∃I")
5062    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5063qed
5064
5065AOT_theorem "eqnotnec:3": FG(𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5066proof-
5067  AOT_have ¬𝒜q0
5068    apply (rule "=dfI"(2)[OF q0_def])
5069     apply (fact "log-prop-prop:2")
5070    by (fact AOT)
5071  AOT_hence 𝒜¬q0
5072    using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5073  AOT_hence 𝒜¬x ([L]x  z q0]x)
5074    using eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)],
5075            THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)],
5076            THEN "RA[2]", THEN "act-cond"[THEN "→E"], THEN "→E"] by blast
5077  moreover AOT_have x ([L]x  z q0]x) using eqnotnec_123_Aux_ξ'[THEN "→E"] q0_prop[THEN "&E"(1)] by blast
5078  ultimately AOT_have 𝒜¬x ([L]x  z q0]x) & x ([L]x  z q0]x) using "&I" by blast
5079  AOT_hence G (𝒜¬x([L]x  [G]x) & x([L]x  [G]x))
5080    by (rule "∃I") "cqt:2[lambda]"
5081  AOT_thus FG (𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5082    apply (rule "∃I")
5083    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5084qed
5085
5086end
5087
5088(* TODO[IMPORTANT]: proof of 219.4 ζ: appeal to (159.2) requires a theorem, but the result has local
5089   assumptions! *)
5090AOT_theorem "eqnotnec:4": FG(x([F]x  [G]x) & ¬x([F]x  [G]x))
5091proof(rule GEN)
5092  fix F
5093
5094  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5095  proof(rule "→I"; rule GEN)
5096    AOT_modally_strict {
5097    fix x
5098    AOT_assume 0: ψ
5099    AOT_have z [F]z & ψ]x  [F]x & ψ
5100      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5101    also AOT_have ...  [F]x
5102      apply (rule "≡I"; rule "→I")
5103      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5104      using 0 "&I" by blast
5105    finally AOT_show [F]x  z [F]z & ψ]x
5106      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5107    }
5108  qed
5109
5110  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5111  proof (rule "→I"; rule GEN)
5112    AOT_modally_strict {
5113      fix x
5114      AOT_assume 0: ψ
5115      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5116        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5117      also AOT_have ...  [F]x
5118        apply (rule "≡I"; rule "→I")
5119        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5120        apply (rule "∨I"(1)) using 0 "&I" by blast
5121      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5122        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5123    }
5124  qed
5125
5126  AOT_have Aux_C:  ¬ψ  ¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5127  proof(rule "RM◇"; rule "→I"; rule "raa-cor:2")
5128  AOT_modally_strict {
5129      AOT_assume 0: ¬ψ
5130      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5131      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5132      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5133          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5134      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5135        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5136      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5137        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5138      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5139      ultimately AOT_have ψ using "≡E" "&E" by metis
5140      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5141    }
5142  qed
5143
5144  AOT_have Aux_D: z ([F]z  z [F]z & ψ]z)  (¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5145  proof (rule "→I")
5146    AOT_assume A: z([F]z  z [F]z & ψ]z)
5147    AOT_show ¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)
5148    proof(rule "≡I"; rule "KBasic:13"[THEN "→E"];
5149          rule "RN[prem]"[where Γ="{«z([F]z  z [F]z & ψ]z)»}", simplified];
5150          (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5151      AOT_modally_strict {
5152        AOT_assume z ([F]z  z [F]z & ψ]z)
5153        AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5154        AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5155        AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5156        AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5157        AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5158      }
5159    next
5160      AOT_modally_strict {
5161        AOT_assume z ([F]z  z [F]z & ψ]z)
5162        AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5163        AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5164        AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5165        AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5166        AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5167      }
5168    qed(auto simp: A)
5169  qed
5170
5171  AOT_obtain p1 where p1_prop: p1 & ¬p1 using "cont-tf-thm:1" "∃E"[rotated] "cont-tf:1"[THEN "≡dfE"] by blast
5172  {
5173    AOT_assume 1: x([F]x  z [F]z & p1]x)
5174    AOT_have 2: x([F]x  z [F]z & p1  ¬p1]x)
5175      using Aux_B[THEN "→E", OF p1_prop[THEN "&E"(1)]].
5176    AOT_have ¬x(z [F]z & p1]x  z [F]z & p1  ¬p1]x)
5177      using Aux_C[THEN "→E", OF p1_prop[THEN "&E"(2)]].
5178    AOT_hence 3: ¬x([F]x  z [F]z & p1  ¬p1]x)
5179      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5180    AOT_hence x([F]x  z [F]z & p1  ¬p1]x) & ¬x([F]x  z [F]z & p1  ¬p1]x) using 2 "&I" by blast
5181    AOT_hence G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5182      by (rule "∃I"(1)) "cqt:2[lambda]"
5183  }
5184  moreover {
5185    AOT_assume 2: ¬x([F]x  z [F]z & p1]x)
5186    AOT_hence ¬x([F]x  z [F]z & p1]x)
5187      using "KBasic:11"[THEN "≡E"(1)] by blast
5188    AOT_hence x ([F]x  z [F]z & p1]x) & ¬x([F]x  z [F]z & p1]x)
5189      using Aux_A[THEN "→E", OF p1_prop[THEN "&E"(1)]] "&I" by blast
5190    AOT_hence G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5191      by (rule "∃I"(1)) "cqt:2[lambda]"
5192  }
5193  ultimately AOT_show G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5194    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5195qed
5196
5197AOT_theorem "eqnotnec:5": FG(¬x([F]x  [G]x) & x([F]x  [G]x))
5198proof(rule GEN)
5199  fix F
5200
5201  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5202  proof(rule "RM◇"; rule "→I"; rule GEN)
5203    AOT_modally_strict {
5204    fix x
5205    AOT_assume 0: ψ
5206    AOT_have z [F]z & ψ]x  [F]x & ψ
5207      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5208    also AOT_have ...  [F]x
5209      apply (rule "≡I"; rule "→I")
5210      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5211      using 0 "&I" by blast
5212    finally AOT_show [F]x  z [F]z & ψ]x
5213      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5214    }
5215  qed
5216
5217  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5218  proof (rule "RM◇"; rule "→I"; rule GEN)
5219    AOT_modally_strict {
5220      fix x
5221      AOT_assume 0: ψ
5222      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5223        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5224      also AOT_have ...  [F]x
5225        apply (rule "≡I"; rule "→I")
5226        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5227        apply (rule "∨I"(1)) using 0 "&I" by blast
5228      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5229        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5230    }
5231  qed
5232
5233  AOT_have Aux_C:  ¬ψ  ¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5234  proof(rule "→I"; rule "raa-cor:2")
5235  AOT_modally_strict {
5236      AOT_assume 0: ¬ψ
5237      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5238      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5239      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5240          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5241      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5242        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5243      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5244        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5245      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5246      ultimately AOT_have ψ using "≡E" "&E" by metis
5247      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5248    }
5249  qed
5250
5251  AOT_have Aux_D: z ([F]z  z [F]z & ψ]z)  (¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5252  proof (rule "→I"; rule "≡I"; (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5253    AOT_modally_strict {
5254      AOT_assume z ([F]z  z [F]z & ψ]z)
5255      AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5256      AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5257      AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5258      AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5259      AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5260    }
5261  next
5262    AOT_modally_strict {
5263      AOT_assume z ([F]z  z [F]z & ψ]z)
5264      AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5265      AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5266      AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5267      AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5268      AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5269    }
5270  qed
5271
5272  AOT_obtain p1 where p1_prop: ¬p1 & p1 using "cont-tf-thm:2" "∃E"[rotated] "cont-tf:2"[THEN "≡dfE"] by blast
5273  {
5274    AOT_assume 1: x([F]x  z [F]z & p1]x)
5275    AOT_have 2: x([F]x  z [F]z & p1  ¬p1]x)
5276      using Aux_B[THEN "→E", OF p1_prop[THEN "&E"(2)]].
5277    AOT_have ¬x(z [F]z & p1]x  z [F]z & p1  ¬p1]x)
5278      using Aux_C[THEN "→E", OF p1_prop[THEN "&E"(1)]].
5279    AOT_hence 3: ¬x([F]x  z [F]z & p1  ¬p1]x)
5280      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5281    AOT_hence ¬x([F]x  z [F]z & p1  ¬p1]x) & x([F]x  z [F]z & p1  ¬p1]x) using 2 "&I" by blast
5282    AOT_hence G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5283      by (rule "∃I"(1)) "cqt:2[lambda]"
5284  }
5285  moreover {
5286    AOT_assume 2: ¬x([F]x  z [F]z & p1]x)
5287    AOT_hence ¬x([F]x  z [F]z & p1]x)
5288      using "KBasic:11"[THEN "≡E"(1)] by blast
5289    AOT_hence ¬x ([F]x  z [F]z & p1]x) & x([F]x  z [F]z & p1]x)
5290      using Aux_A[THEN "→E", OF p1_prop[THEN "&E"(2)]] "&I" by blast
5291    AOT_hence G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5292      by (rule "∃I"(1)) "cqt:2[lambda]"
5293  }
5294  ultimately AOT_show G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5295    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5296qed
5297
5298AOT_theorem "eqnotnec:6": FG(𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5299proof(rule GEN)
5300  fix F
5301
5302  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5303  proof(rule "RM◇"; rule "→I"; rule GEN)
5304    AOT_modally_strict {
5305    fix x
5306    AOT_assume 0: ψ
5307    AOT_have z [F]z & ψ]x  [F]x & ψ
5308      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5309    also AOT_have ...  [F]x
5310      apply (rule "≡I"; rule "→I")
5311      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5312      using 0 "&I" by blast
5313    finally AOT_show [F]x  z [F]z & ψ]x
5314      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5315    }
5316  qed
5317
5318  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5319  proof (rule "RM◇"; rule "→I"; rule GEN)
5320    AOT_modally_strict {
5321      fix x
5322      AOT_assume 0: ψ
5323      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5324        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5325      also AOT_have ...  [F]x
5326        apply (rule "≡I"; rule "→I")
5327        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5328        apply (rule "∨I"(1)) using 0 "&I" by blast
5329      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5330        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5331    }
5332  qed
5333
5334  AOT_have Aux_C:  𝒜¬ψ  𝒜¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5335  proof(rule "act-cond"[THEN "→E"]; rule "RA[2]"; rule "→I"; rule "raa-cor:2")
5336  AOT_modally_strict {
5337      AOT_assume 0: ¬ψ
5338      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5339      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5340      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5341          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5342      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5343        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5344      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5345        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5346      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5347      ultimately AOT_have ψ using "≡E" "&E" by metis
5348      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5349    }
5350  qed
5351
5352  AOT_have Aux_D: 𝒜z ([F]z  z [F]z & ψ]z)  (𝒜¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  𝒜¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5353  proof (rule "→I"; rule "Act-Basic:5"[THEN "≡E"(1)])
5354    AOT_assume 𝒜z ([F]z  z [F]z & ψ]z)
5355    AOT_thus 𝒜(¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x))
5356    proof (rule "RA[3]"[where Γ="{«z ([F]z  z [F]z & ψ]z)»}", simplified, rotated])
5357      AOT_modally_strict {
5358        AOT_assume z ([F]z  z [F]z & ψ]z)
5359        AOT_thus ¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)
5360          apply -
5361        proof(rule "≡I"; (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5362        AOT_modally_strict {
5363          AOT_assume z ([F]z  z [F]z & ψ]z)
5364          AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5365          AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5366          AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5367          AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5368          AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5369        }
5370      next
5371        AOT_modally_strict {
5372          AOT_assume z ([F]z  z [F]z & ψ]z)
5373          AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5374          AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5375          AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5376          AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5377          AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5378        }
5379      qed
5380      }
5381    qed
5382  qed
5383
5384  AOT_have ¬𝒜q0
5385    apply (rule "=dfI"(2)[OF q0_def])
5386     apply (fact "log-prop-prop:2")
5387    by (fact AOT)
5388  AOT_hence q0_prop_1: 𝒜¬q0
5389    using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5390  {
5391    AOT_assume 1: 𝒜x([F]x  z [F]z & q0]x)
5392    AOT_have 2: x([F]x  z [F]z & q0  ¬q0]x)
5393      using Aux_B[THEN "→E", OF q0_prop[THEN "&E"(1)]].
5394    AOT_have 𝒜¬x(z [F]z & q0]x  z [F]z & q0  ¬q0]x)
5395      using Aux_C[THEN "→E", OF q0_prop_1].
5396    AOT_hence 3: 𝒜¬x([F]x  z [F]z & q0  ¬q0]x)
5397      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5398    AOT_hence 𝒜¬x([F]x  z [F]z & q0  ¬q0]x) & x([F]x  z [F]z & q0  ¬q0]x) using 2 "&I" by blast
5399    AOT_hence G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5400      by (rule "∃I"(1)) "cqt:2[lambda]"
5401  }
5402  moreover {
5403    AOT_assume 2: ¬𝒜x([F]x  z [F]z & q0]x)
5404    AOT_hence 𝒜¬x([F]x  z [F]z & q0]x)
5405      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5406    AOT_hence 𝒜¬x ([F]x  z [F]z & q0]x) & x([F]x  z [F]z & q0]x)
5407      using Aux_A[THEN "→E", OF q0_prop[THEN "&E"(1)]] "&I" by blast
5408    AOT_hence G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5409      by (rule "∃I"(1)) "cqt:2[lambda]"
5410  }
5411  ultimately AOT_show G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5412    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5413qed
5414
5415AOT_theorem "oa-contingent:1": O!  A!
5416proof(rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
5417  fix x
5418  AOT_assume 1: O! = A!
5419  AOT_hence x E!x] = A!
5420    by (rule "=dfE"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5421  AOT_hence x E!x] = x ¬E!x]
5422    by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5423  moreover AOT_have x E!x]x  E!x
5424    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5425  ultimately AOT_have x ¬E!x]x  E!x
5426    using "rule=E" by fast
5427  moreover AOT_have x ¬E!x]x  ¬E!x
5428    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5429  ultimately AOT_have E!x  ¬E!x using "≡E"(6) "Commutativity of ≡"[THEN "≡E"(1)] by blast
5430  AOT_thus "(E!x  ¬E!x) & ¬(E!x  ¬E!x)" using "oth-class-taut:3:c" "&I" by blast
5431qed
5432
5433AOT_theorem "oa-contingent:2": O!x  ¬A!x
5434proof -
5435  AOT_have O!x  x E!x]x
5436    apply (rule "≡I"; rule "→I")
5437     apply (rule "=dfE"(2)[OF AOT_ordinary])
5438      apply "cqt:2[lambda]"
5439     apply argo
5440    apply (rule  "=dfI"(2)[OF AOT_ordinary])
5441     apply "cqt:2[lambda]"
5442    by argo
5443  also AOT_have   E!x
5444    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5445  also AOT_have   ¬¬E!x
5446    using "oth-class-taut:3:b".
5447  also AOT_have   ¬x ¬E!x]x
5448    by (rule "beta-C-meta"[THEN "→E", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], symmetric]) "cqt:2[lambda]"
5449  also AOT_have   ¬A!x
5450    apply (rule "≡I"; rule "→I")
5451     apply (rule "=dfI"(2)[OF AOT_abstract])
5452      apply "cqt:2[lambda]"
5453     apply argo
5454    apply (rule "=dfE"(2)[OF AOT_abstract])
5455     apply "cqt:2[lambda]"
5456    by argo
5457  finally show ?thesis.
5458qed
5459
5460AOT_theorem "oa-contingent:3": A!x  ¬O!x
5461  by (AOT_subst "«A!x»" "«¬¬A!x»")
5462     (auto simp add: "oth-class-taut:3:b" "oa-contingent:2"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], symmetric])
5463
5464AOT_theorem "oa-contingent:4": Contingent(O!)
5465proof (rule "thm-cont-prop:2"[unvarify F, OF "oa-exist:1", THEN "≡E"(2)]; rule "&I")
5466  AOT_have x E!x using "thm-cont-e:3" .
5467  AOT_hence x E!x using "BF◇"[THEN "→E"] by blast
5468  then AOT_obtain a where E!a using "∃E"[rotated] by blast
5469  AOT_hence x E!x]a
5470    by (rule "beta-C-meta"[THEN "→E", THEN "≡E"(2), rotated]) "cqt:2[lambda]"
5471  AOT_hence O!a
5472    by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5473  AOT_hence x O!x using "∃I" by blast
5474  AOT_thus x O!x using "T◇"[THEN "→E"] by blast
5475next
5476  AOT_obtain a where A!a
5477    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5478  AOT_hence ¬O!a using "oa-contingent:3"[THEN "≡E"(1)] by blast
5479  AOT_hence x ¬O!x using "∃I" by fast
5480  AOT_thus x ¬O!x using "T◇"[THEN "→E"] by blast
5481qed
5482
5483AOT_theorem "oa-contingent:5": Contingent(A!)
5484proof (rule "thm-cont-prop:2"[unvarify F, OF "oa-exist:2", THEN "≡E"(2)]; rule "&I")
5485  AOT_obtain a where A!a
5486    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5487  AOT_hence x A!x using "∃I" by fast
5488  AOT_thus x A!x using "T◇"[THEN "→E"] by blast
5489next
5490  AOT_have x E!x using "thm-cont-e:3" .
5491  AOT_hence x E!x using "BF◇"[THEN "→E"] by blast
5492  then AOT_obtain a where E!a using "∃E"[rotated] by blast
5493  AOT_hence x E!x]a
5494    by (rule "beta-C-meta"[THEN "→E", THEN "≡E"(2), rotated]) "cqt:2[lambda]"
5495  AOT_hence O!a
5496    by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5497  AOT_hence ¬A!a using "oa-contingent:2"[THEN "≡E"(1)] by blast
5498  AOT_hence x ¬A!x using "∃I" by fast
5499  AOT_thus x ¬A!x using "T◇"[THEN "→E"] by blast
5500qed
5501
5502AOT_theorem "oa-contingent:7": O!-x  ¬A!-x
5503proof -
5504  AOT_have O!x  ¬A!x
5505    using "oa-contingent:2" by blast
5506  also AOT_have   A!-x
5507    using "thm-relation-negation:1"[symmetric, unvarify F, OF "oa-exist:2"].
5508  finally AOT_have 1: O!x  A!-x.
5509
5510  AOT_have A!x  ¬O!x
5511    using "oa-contingent:3" by blast
5512  also AOT_have   O!-x
5513    using "thm-relation-negation:1"[symmetric, unvarify F, OF "oa-exist:1"].
5514  finally AOT_have 2: A!x  O!-x.
5515
5516  AOT_show O!-x  ¬A!-x
5517    using 1[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "oa-contingent:3"[of _ x] 2[symmetric]
5518          "≡E"(5) by blast
5519qed
5520
5521AOT_theorem "oa-contingent:6": O!-  A!-
5522proof (rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
5523  AOT_assume 1: O!- = A!-
5524  fix x
5525  AOT_have A!-x  O!-x
5526    apply (rule "rule=E"[rotated, OF 1]) by (fact "oth-class-taut:3:a")
5527  AOT_hence A!-x  ¬A!-x
5528    using "oa-contingent:7" "≡E" by fast
5529  AOT_thus (A!-x  ¬A!-x) & ¬(A!-x  ¬A!-x) using "oth-class-taut:3:c" "&I" by blast
5530qed
5531
5532AOT_theorem "oa-contingent:8": Contingent(O!-)
5533  using "thm-cont-prop:3"[unvarify F, OF "oa-exist:1", THEN "≡E"(1), OF "oa-contingent:4"].
5534
5535AOT_theorem "oa-contingent:9": Contingent(A!-)
5536  using "thm-cont-prop:3"[unvarify F, OF "oa-exist:2", THEN "≡E"(1), OF "oa-contingent:5"].
5537
5538AOT_define WeaklyContingent :: ‹Π  φ› ("WeaklyContingent'(_')")
5539  "df-cont-nec": "WeaklyContingent([F]) df Contingent([F]) & x ([F]x  [F]x)"
5540
5541AOT_theorem "cont-nec-fact1:1": WeaklyContingent([F])  WeaklyContingent([F]-)
5542proof -
5543  AOT_have WeaklyContingent([F])  Contingent([F]) & x ([F]x  [F]x)
5544    using "df-cont-nec"[THEN "≡Df"] by blast
5545  also AOT_have ...  Contingent([F]-) & x ([F]x  [F]x)
5546    apply (rule "oth-class-taut:8:f"[THEN "≡E"(2)]; rule "→I")
5547    using "thm-cont-prop:3".
5548  also AOT_have   Contingent([F]-) & x ([F]-x  [F]-x)
5549  proof (rule "oth-class-taut:8:e"[THEN "≡E"(2)]; rule "→I"; rule "≡I"; rule "→I"; rule GEN; rule "→I")
5550    fix x
5551    AOT_assume 0: x ([F]x  [F]x)
5552    AOT_assume 1: [F]-x
5553    AOT_have ¬[F]x
5554      by (AOT_subst_rev "«[F]-x»" "«¬[F]x»")
5555         (auto simp add: "thm-relation-negation:1" 1)
5556    AOT_hence 2: ¬[F]x
5557      using "KBasic:11"[THEN "≡E"(2)] by blast
5558    AOT_show [F]-x
5559    proof (rule "raa-cor:1")
5560      AOT_assume 3: ¬[F]-x
5561      AOT_have ¬¬[F]x
5562        by (AOT_subst_rev "«[F]-x»" "«¬[F]x»")
5563           (auto simp add: "thm-relation-negation:1" 3)
5564      AOT_hence [F]x
5565        using "conventions:5"[THEN "≡dfI"] by simp
5566      AOT_hence [F]x using 0 "∀E" "→E" by fast
5567      AOT_thus [F]x & ¬[F]x using "&I" 2 by blast
5568    qed
5569  next
5570    fix x
5571    AOT_assume 0: x ([F]-x  [F]-x)
5572    AOT_assume 1: [F]x
5573    AOT_have ¬[F]-x
5574      by (AOT_subst "«¬[F]-x»" "«[F]x»")
5575         (auto simp: "thm-relation-negation:2" 1)
5576    AOT_hence 2: ¬[F]-x
5577      using "KBasic:11"[THEN "≡E"(2)] by blast
5578    AOT_show [F]x
5579    proof (rule "raa-cor:1")
5580      AOT_assume 3: ¬[F]x
5581      AOT_have ¬¬[F]-x
5582        by (AOT_subst "«¬[F]-x»" "«[F]x»")
5583           (auto simp add: "thm-relation-negation:2" 3)
5584      AOT_hence [F]-x
5585        using "conventions:5"[THEN "≡dfI"] by simp
5586      AOT_hence [F]-x using 0 "∀E" "→E" by fast
5587      AOT_thus [F]-x & ¬[F]-x using "&I" 2 by blast
5588    qed
5589  qed
5590  also AOT_have   WeaklyContingent([F]-)
5591    using "df-cont-nec"[THEN "≡Df", symmetric] by blast
5592  finally show ?thesis.
5593qed
5594
5595AOT_theorem "cont-nec-fact1:2": (WeaklyContingent([F]) & ¬WeaklyContingent([G]))  F  G
5596proof (rule "→I"; rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
5597  AOT_assume 1: WeaklyContingent([F]) & ¬WeaklyContingent([G])
5598  AOT_hence WeaklyContingent([F]) using "&E" by blast
5599  moreover AOT_assume F = G
5600  ultimately AOT_have WeaklyContingent([G])
5601    using "rule=E" by blast
5602  AOT_thus WeaklyContingent([G]) & ¬WeaklyContingent([G])
5603    using 1 "&I" "&E" by blast
5604qed
5605
5606AOT_theorem "cont-nec-fact2:1": WeaklyContingent(O!)
5607proof (rule "df-cont-nec"[THEN "≡dfI"]; rule "&I")
5608  AOT_show Contingent(O!)
5609    using "oa-contingent:4".
5610next
5611  AOT_show x ([O!]x  [O!]x)
5612    apply (rule GEN; rule "→I")
5613    using "oa-facts:5"[THEN "≡E"(1)] by blast
5614qed
5615
5616
5617AOT_theorem "cont-nec-fact2:2": WeaklyContingent(A!)
5618proof (rule "df-cont-nec"[THEN "≡dfI"]; rule "&I")
5619  AOT_show Contingent(A!)
5620    using "oa-contingent:5".
5621next
5622  AOT_show x ([A!]x  [A!]x)
5623    apply (rule GEN; rule "→I")
5624    using "oa-facts:6"[THEN "≡E"(1)] by blast
5625qed
5626
5627AOT_theorem "cont-nec-fact2:3": ¬WeaklyContingent(E!)
5628proof (rule "df-cont-nec"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)];
5629       rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(2); rule "raa-cor:2")
5630  AOT_have x (E!x & ¬𝒜E!x) using "qml:4"[axiom_inst].
5631  AOT_hence x (E!x & ¬𝒜E!x) using "BF◇"[THEN "→E"] by blast
5632  then AOT_obtain a where (E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
5633  AOT_hence 1: E!a & ¬𝒜E!a using "KBasic2:3"[THEN "→E"] by simp
5634  moreover AOT_assume x ([E!]x  [E!]x)
5635  ultimately AOT_have E!a using "&E" "∀E" "→E" by fast
5636  AOT_hence 𝒜E!a using "nec-imp-act"[THEN "→E"] by blast
5637  AOT_hence 𝒜E!a using "qml-act:1"[axiom_inst, THEN "→E"] by blast
5638  moreover AOT_have ¬𝒜E!a using "KBasic:11"[THEN "≡E"(2)] 1[THEN "&E"(2)] by meson
5639  ultimately AOT_have 𝒜E!a & ¬𝒜E!a using "&I" by blast
5640  AOT_thus p & ¬p for p using "raa-cor:1" by blast
5641qed
5642
5643AOT_theorem "cont-nec-fact2:4": ¬WeaklyContingent(L)
5644  apply (rule "df-cont-nec"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)];
5645       rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(1))
5646  apply (rule "contingent-properties:4"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
5647  apply (rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(2); rule "useful-tautologies:2"[THEN "→E"])
5648  using "thm-noncont-e-e:3"[THEN "contingent-properties:3"[THEN "≡dfE"]].
5649
5650(* TODO: cleanup *)
5651AOT_theorem "cont-nec-fact2:5": O!  E! & O!  E!- & O!  L & O!  L-
5652proof -
5653  AOT_have 1: L
5654    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5655  {
5656    fix φ and Π and Π'
5657    AOT_have A: ¬(φ{Π'}  φ{Π}) if  φ{Π} and ¬φ{Π'}
5658    proof (rule "raa-cor:2")
5659      AOT_assume φ{Π'}  φ{Π}
5660      AOT_hence φ{Π'} using that(1) "≡E" by blast
5661      AOT_thus φ{Π'} & ¬φ{Π'} using that(2) "&I" by blast
5662    qed
5663    AOT_have Π'  Π if Π and Π' and φ{Π} and ¬φ{Π'}
5664      using "pos-not-equiv-ne:4"[unvarify F G, THEN "→E", OF that(1,2), OF A[OF that(3, 4)]].
5665  } note 0 = this
5666  show ?thesis
5667    apply(safe intro!: "&I"; rule 0)
5668    using "cqt:2[concrete]"[axiom_inst] apply blast
5669    using "oa-exist:1" apply blast
5670    using "cont-nec-fact2:3" apply fast
5671    apply (rule "useful-tautologies:2"[THEN "→E"])
5672    using "cont-nec-fact2:1" apply fast
5673    using "rel-neg-T:3" apply fast
5674    using "oa-exist:1" apply blast
5675    using "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:3", OF "cqt:2[concrete]"[axiom_inst]] apply fast
5676    apply (rule "useful-tautologies:2"[THEN "→E"])
5677    using "cont-nec-fact2:1" apply blast
5678    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5679    using "oa-exist:1" apply fast
5680    using "cont-nec-fact2:4" apply fast
5681    apply (rule "useful-tautologies:2"[THEN "→E"])
5682    using "cont-nec-fact2:1" apply fast
5683    using "rel-neg-T:3" apply fast
5684    using "oa-exist:1" apply fast
5685    apply (rule "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:4"])
5686    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5687    apply (rule "useful-tautologies:2"[THEN "→E"])
5688    using "cont-nec-fact2:1" by blast
5689qed
5690
5691(* TODO: cleanup together with above *)
5692AOT_theorem "cont-nec-fact2:6": A!  E! & A!  E!- & A!  L & A!  L-
5693proof -
5694  AOT_have 1: L
5695    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5696  {
5697    fix φ and Π and Π'
5698    AOT_have A: ¬(φ{Π'}  φ{Π}) if  φ{Π} and ¬φ{Π'}
5699    proof (rule "raa-cor:2")
5700      AOT_assume φ{Π'}  φ{Π}
5701      AOT_hence φ{Π'} using that(1) "≡E" by blast
5702      AOT_thus φ{Π'} & ¬φ{Π'} using that(2) "&I" by blast
5703    qed
5704    AOT_have Π'  Π if Π and Π' and φ{Π} and ¬φ{Π'}
5705      using "pos-not-equiv-ne:4"[unvarify F G, THEN "→E", OF that(1,2), OF A[OF that(3, 4)]].
5706  } note 0 = this
5707  show ?thesis
5708    apply(safe intro!: "&I"; rule 0)
5709    using "cqt:2[concrete]"[axiom_inst] apply blast
5710    using "oa-exist:2" apply blast
5711    using "cont-nec-fact2:3" apply fast
5712    apply (rule "useful-tautologies:2"[THEN "→E"])
5713    using "cont-nec-fact2:2" apply fast
5714    using "rel-neg-T:3" apply fast
5715    using "oa-exist:2" apply blast
5716    using "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:3", OF "cqt:2[concrete]"[axiom_inst]] apply fast
5717    apply (rule "useful-tautologies:2"[THEN "→E"])
5718    using "cont-nec-fact2:2" apply blast
5719    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5720    using "oa-exist:2" apply fast
5721    using "cont-nec-fact2:4" apply fast
5722    apply (rule "useful-tautologies:2"[THEN "→E"])
5723    using "cont-nec-fact2:2" apply fast
5724    using "rel-neg-T:3" apply fast
5725    using "oa-exist:2" apply fast
5726    apply (rule "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:4"])
5727    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5728    apply (rule "useful-tautologies:2"[THEN "→E"])
5729    using "cont-nec-fact2:2" by blast
5730qed
5731
5732AOT_define necessary_or_contingently_false :: ‹φ  φ› ("Δ_" [49] 54)
5733  Δp df p  (¬𝒜p & p)
5734
5735AOT_theorem sixteen:
5736 shows F1F2F3F4F5F6F7F8F9F10F11F12F13F14F15F16 (
5737«F1::<κ>»  F2 & F1  F3 & F1  F4 & F1  F5 & F1  F6 & F1  F7 & F1  F8 & F1  F9 & F1  F10 & F1  F11 & F1  F12 & F1  F13 & F1  F14 & F1  F15 & F1  F16 &
5738F2  F3 & F2  F4 & F2  F5 & F2  F6 & F2  F7 & F2  F8 & F2  F9 & F2  F10 & F2  F11 & F2  F12 & F2  F13 & F2  F14 & F2  F15 & F2  F16 &
5739F3  F4 & F3  F5 & F3  F6 & F3  F7 & F3  F8 & F3  F9 & F3  F10 & F3  F11 & F3  F12 & F3  F13 & F3  F14 & F3  F15 & F3  F16 &
5740F4  F5 & F4  F6 & F4  F7 & F4  F8 & F4  F9 & F4  F10 & F4  F11 & F4  F12 & F4  F13 & F4  F14 & F4  F15 & F4  F16 &
5741F5  F6 & F5  F7 & F5  F8 & F5  F9 & F5  F10 & F5  F11 & F5  F12 & F5  F13 & F5  F14 & F5  F15 & F5  F16 &
5742F6  F7 & F6  F8 & F6  F9 & F6  F10 & F6  F11 & F6  F12 & F6  F13 & F6  F14 & F6  F15 & F6  F16 &
5743F7  F8 & F7  F9 & F7  F10 & F7  F11 & F7  F12 & F7  F13 & F7  F14 & F7  F15 & F7  F16 &
5744F8  F9 & F8  F10 & F8  F11 & F8  F12 & F8  F13 & F8  F14 & F8  F15 & F8  F16 &
5745F9  F10 & F9  F11 & F9  F12 & F9  F13 & F9  F14 & F9  F15 & F9  F16 &
5746F10  F11 & F10  F12 & F10  F13 & F10  F14 & F10  F15 & F10  F16 &
5747F11  F12 & F11  F13 & F11  F14 & F11  F15 & F11  F16 &
5748F12  F13 & F12  F14 & F12  F15 & F12  F16 &
5749F13  F14 & F13  F15 & F13  F16 &
5750F14  F15 & F14  F16 &
5751F15  F16) 
5752proof -
5753
5754  AOT_have Delta_pos: Δφ  φ for φ
5755  proof(rule "→I")
5756    AOT_assume Δφ
5757    AOT_hence φ  (¬𝒜φ & φ)
5758      using "≡dfE"[OF necessary_or_contingently_false] by blast
5759    moreover {
5760      AOT_assume φ
5761      AOT_hence φ
5762        by (metis "B◇" "T◇" "vdash-properties:10")
5763    }
5764    moreover {
5765      AOT_assume ¬𝒜φ & φ
5766      AOT_hence φ
5767        using "&E" by blast
5768    }
5769    ultimately AOT_show φ
5770      by (metis "∨E"(2) "raa-cor:1") 
5771  qed
5772
5773  AOT_have act_and_not_nec_not_delta: ¬Δφ if 𝒜φ and ¬φ for φ
5774    using "≡dfE" "&E"(1) "∨E"(2) necessary_or_contingently_false "raa-cor:3" that(1) that(2) by blast
5775  AOT_have act_and_pos_not_not_delta: ¬Δφ if 𝒜φ and ¬φ for φ
5776    using "KBasic:11" act_and_not_nec_not_delta "≡E"(2) that(1) that(2) by blast
5777  AOT_have impossible_delta: ¬Δφ if ¬φ for φ
5778    using Delta_pos "modus-tollens:1" that by blast
5779  AOT_have not_act_and_pos_delta: Δφ if ¬𝒜φ and φ for φ
5780    by (meson "≡dfI" "&I" "∨I"(2) necessary_or_contingently_false that(1) that(2))
5781  AOT_have nec_delta: Δφ if φ for φ
5782    using "≡dfI" "∨I"(1) necessary_or_contingently_false that by blast
5783
5784  AOT_obtain a where a_prop: A!a
5785    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5786  AOT_obtain b where b_prop: [E!]b & ¬𝒜[E!]b
5787    using "pos-not-pna:3" using "∃E"[rotated] by blast
5788
5789  AOT_have b_ord: [O!]b
5790  proof(rule "=dfI"(2)[OF AOT_ordinary])
5791    AOT_show x [E!]x] by "cqt:2[lambda]"
5792  next
5793    AOT_show x [E!]x]b
5794    proof (rule "β←C"(1); ("cqt:2[lambda]")?)
5795      AOT_show b by (rule "cqt:2[const_var]"[axiom_inst])
5796      AOT_show [E!]b by (fact b_prop[THEN "&E"(1)])
5797    qed
5798  qed
5799
5800  AOT_have nec_not_L_neg: ¬[L-]x for x
5801    using "thm-noncont-e-e:2" "contingent-properties:2"[THEN "≡dfE"] "&E"
5802          CBF[THEN "→E"] "∀E" by blast
5803  AOT_have nec_L: [L]x for x
5804    using "thm-noncont-e-e:1" "contingent-properties:1"[THEN "≡dfE"]
5805      CBF[THEN "→E"] "∀E" by blast
5806
5807  AOT_have act_ord_b: 𝒜[O!]b
5808    using b_ord "≡E"(1) "oa-facts:7" by blast
5809  AOT_have delta_ord_b: Δ[O!]b
5810    by (meson "≡dfI" b_ord "∨I"(1) necessary_or_contingently_false "oa-facts:1" "vdash-properties:10")
5811  AOT_have not_act_ord_a: ¬𝒜[O!]a
5812    by (meson a_prop "≡E"(1) "≡E"(3) "oa-contingent:3" "oa-facts:7")
5813  AOT_have not_delta_ord_a: ¬Δ[O!]a
5814    by (metis Delta_pos "≡E"(4) not_act_ord_a "oa-facts:3" "oa-facts:7" "reductio-aa:1" "vdash-properties:10")
5815
5816  AOT_have not_act_abs_b: ¬𝒜[A!]b
5817    by (meson b_ord "≡E"(1) "≡E"(3) "oa-contingent:2" "oa-facts:8")
5818  AOT_have not_delta_abs_b: ¬Δ[A!]b
5819  proof(rule "raa-cor:2")
5820    AOT_assume Δ[A!]b
5821    AOT_hence [A!]b
5822      by (metis Delta_pos "vdash-properties:10")
5823    AOT_thus [A!]b & ¬[A!]b
5824      by (metis b_ord "&I" "≡E"(1) "oa-contingent:2" "oa-facts:4" "vdash-properties:10")
5825  qed
5826  AOT_have act_abs_a: 𝒜[A!]a
5827    using a_prop "≡E"(1) "oa-facts:8" by blast
5828  AOT_have delta_abs_a: Δ[A!]a
5829      by (metis "≡dfI" a_prop "oa-facts:2" "vdash-properties:10" "∨I"(1) necessary_or_contingently_false)
5830
5831  AOT_have not_act_concrete_b: ¬𝒜[E!]b
5832    using b_prop "&E"(2) by blast
5833  AOT_have delta_concrete_b: Δ[E!]b
5834  proof (rule "≡dfI"[OF necessary_or_contingently_false]; rule "∨I"(2); rule "&I")
5835    AOT_show ¬𝒜[E!]b using b_prop "&E"(2) by blast
5836  next
5837    AOT_show [E!]b using b_prop "&E"(1) by blast
5838  qed
5839  AOT_have not_act_concrete_a: ¬𝒜[E!]a
5840  proof (rule "raa-cor:2")
5841    AOT_assume 𝒜[E!]a
5842    AOT_hence 1: [E!]a by (metis "Act-Sub:3" "vdash-properties:10")
5843    AOT_have [A!]a by (simp add: a_prop)
5844    AOT_hence x ¬[E!]x]a
5845      by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5846    AOT_hence ¬[E!]a using "β→C"(1) by blast
5847    AOT_thus [E!]a & ¬[E!]a using 1 "&I" by blast
5848  qed
5849  AOT_have not_delta_concrete_a: ¬Δ[E!]a
5850  proof (rule "raa-cor:2")
5851    AOT_assume Δ[E!]a
5852    AOT_hence 1: [E!]a by (metis Delta_pos "vdash-properties:10")
5853    AOT_have [A!]a by (simp add: a_prop)
5854    AOT_hence x ¬[E!]x]a
5855      by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5856    AOT_hence ¬[E!]a using "β→C"(1) by blast
5857    AOT_thus [E!]a & ¬[E!]a using 1 "&I" by blast
5858  qed
5859
5860  AOT_have not_act_q_zero: ¬𝒜q0
5861    by (meson "log-prop-prop:2" "pos-not-pna:1" q0_def "reductio-aa:1" "rule-id-def:2:a[zero]")
5862  AOT_have delta_q_zero: Δq0
5863  proof(rule "≡dfI"[OF necessary_or_contingently_false]; rule "∨I"(2); rule "&I")
5864    AOT_show ¬𝒜q0 using not_act_q_zero.
5865    AOT_show q0 by (meson "&E"(1) q0_prop)
5866  qed
5867  AOT_have act_not_q_zero: 𝒜¬q0 using "Act-Basic:1" "∨E"(2) not_act_q_zero by blast
5868  AOT_have not_delta_not_q_zero: ¬Δ¬q0
5869      using "≡dfE" "conventions:5" "Act-Basic:1" act_and_not_nec_not_delta "&E"(1) "∨E"(2) not_act_q_zero q0_prop by blast
5870
5871  AOT_have [L-] by (simp add: "rel-neg-T:3")
5872  moreover AOT_have ¬𝒜[L-]b & ¬Δ[L-]b & ¬𝒜[L-]a & ¬Δ[L-]a
5873  proof (safe intro!: "&I")
5874    AOT_show ¬𝒜[L-]b by (meson "≡E"(1) "logic-actual-nec:1"[axiom_inst] "nec-imp-act" nec_not_L_neg "→E")
5875    AOT_show ¬Δ[L-]b by (meson Delta_pos "KBasic2:1" "≡E"(1) "modus-tollens:1" nec_not_L_neg)
5876    AOT_show ¬𝒜[L-]a by (meson "≡E"(1) "logic-actual-nec:1"[axiom_inst] "nec-imp-act" nec_not_L_neg "→E")
5877    AOT_show ¬Δ[L-]a using Delta_pos "KBasic2:1" "≡E"(1) "modus-tollens:1" nec_not_L_neg by blast
5878  qed
5879  ultimately AOT_obtain F0 where ¬𝒜[F0]b & ¬Δ[F0]b & ¬𝒜[F0]a & ¬Δ[F0]a
5880    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5881  AOT_hence ¬𝒜[F0]b and ¬Δ[F0]b and ¬𝒜[F0]a and ¬Δ[F0]a
5882    using "&E" by blast+
5883  note props = this
5884
5885  let  = "«y [A!]y & q0]»"
5886  AOT_modally_strict {
5887    AOT_have [«»] by "cqt:2[lambda]"
5888  } note 1 = this
5889  moreover AOT_have¬𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
5890  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
5891    AOT_show ¬𝒜([A!]b & q0)
5892      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_abs_b "raa-cor:3" by blast
5893  next AOT_show ¬Δ([A!]b & q0)
5894      by (metis Delta_pos "KBasic2:3" "&E"(1) "≡E"(4) not_act_abs_b "oa-facts:4" "oa-facts:8" "raa-cor:3" "vdash-properties:10")
5895  next AOT_show ¬𝒜([A!]a & q0)
5896      using "Act-Basic:2" "&E"(2) "≡E"(1) not_act_q_zero "raa-cor:3" by blast
5897  next AOT_show Δ([A!]a & q0)
5898    proof (rule not_act_and_pos_delta)
5899      AOT_show ¬𝒜([A!]a & q0)
5900        using "Act-Basic:2" "&E"(2) "≡E"(4) not_act_q_zero "raa-cor:3" by blast
5901    next AOT_show ([A!]a & q0)
5902        by (metis "&I" "→E" Delta_pos "KBasic:16" "&E"(1) delta_abs_a "≡E"(1) "oa-facts:6" q0_prop)
5903    qed
5904  qed
5905  ultimately AOT_obtain F1 where ¬𝒜[F1]b & ¬Δ[F1]b & ¬𝒜[F1]a & Δ[F1]a
5906    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5907  AOT_hence ¬𝒜[F1]b and ¬Δ[F1]b and ¬𝒜[F1]a and Δ[F1]a
5908    using "&E" by blast+
5909  note props = props this
5910
5911  let  = "«y [A!]y & ¬q0]»"
5912  AOT_modally_strict {
5913    AOT_have [«»] by "cqt:2[lambda]"
5914  } note 1 = this
5915  moreover AOT_have ¬𝒜[«»]b & ¬Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
5916  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
5917    AOT_show ¬𝒜([A!]b & ¬q0)
5918      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_abs_b "raa-cor:3" by blast
5919  next AOT_show ¬Δ([A!]b & ¬q0)
5920      by (meson "RM◇" Delta_pos "Conjunction Simplification"(1) "≡E"(4) "modus-tollens:1" not_act_abs_b "oa-facts:4" "oa-facts:8")
5921  next AOT_show 𝒜([A!]a & ¬q0)
5922      by (metis "Act-Basic:1" "Act-Basic:2" act_abs_a "&I" "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:3")
5923  next AOT_show ¬Δ([A!]a & ¬q0)
5924    proof (rule act_and_not_nec_not_delta)
5925      AOT_show 𝒜([A!]a & ¬q0)
5926        by (metis "Act-Basic:1" "Act-Basic:2" act_abs_a "&I" "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:3")
5927    next
5928      AOT_show ¬([A!]a & ¬q0)
5929        by (metis "KBasic2:1" "KBasic:3" "&E"(1) "&E"(2) "≡E"(4) q0_prop "raa-cor:3")
5930    qed
5931  qed
5932  ultimately AOT_obtain F2 where ¬𝒜[F2]b & ¬Δ[F2]b & 𝒜[F2]a & ¬Δ[F2]a
5933    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5934  AOT_hence ¬𝒜[F2]b and ¬Δ[F2]b and 𝒜[F2]a and ¬Δ[F2]a
5935    using "&E" by blast+
5936  note props = props this
5937
5938  AOT_have abstract_prop: ¬𝒜[A!]b & ¬Δ[A!]b & 𝒜[A!]a & Δ[A!]a
5939    using act_abs_a "&I" delta_abs_a not_act_abs_b not_delta_abs_b by presburger
5940  then AOT_obtain F3 where ¬𝒜[F3]b & ¬Δ[F3]b & 𝒜[F3]a & Δ[F3]a
5941    using "∃I"(1)[rotated, THEN "∃E"[rotated]] "oa-exist:2" by fastforce
5942  AOT_hence ¬𝒜[F3]b and ¬Δ[F3]b and 𝒜[F3]a and Δ[F3]a
5943    using "&E" by blast+
5944  note props = props this
5945
5946  AOT_have ¬𝒜[E!]b & Δ[E!]b & ¬𝒜[E!]a & ¬Δ[E!]a
5947    by (meson "&I" delta_concrete_b not_act_concrete_a not_act_concrete_b not_delta_concrete_a)
5948  then AOT_obtain F4 where ¬𝒜[F4]b & Δ[F4]b & ¬𝒜[F4]a & ¬Δ[F4]a
5949    using "cqt:2[concrete]"[axiom_inst] "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5950  AOT_hence ¬𝒜[F4]b and Δ[F4]b and ¬𝒜[F4]a and ¬Δ[F4]a
5951    using "&E" by blast+
5952  note props = props this
5953
5954  AOT_modally_strict {
5955    AOT_have y q0] by "cqt:2[lambda]"
5956  } note 1 = this
5957  moreover AOT_have ¬𝒜y q0]b & Δy q0]b & ¬𝒜y q0]a & Δy q0]a
5958    by (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
5959       (auto simp: not_act_q_zero delta_q_zero)
5960  ultimately AOT_obtain F5 where ¬𝒜[F5]b & Δ[F5]b & ¬𝒜[F5]a & Δ[F5]a
5961    using "cqt:2[concrete]"[axiom_inst] "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5962  AOT_hence ¬𝒜[F5]b and Δ[F5]b and ¬𝒜[F5]a and Δ[F5]a
5963    using "&E" by blast+
5964  note props = props this
5965
5966  let  = "«y [E!]y  ([A!]y & ¬q0)]»"
5967  AOT_modally_strict {
5968    AOT_have [«»] by "cqt:2[lambda]"
5969  } note 1 = this
5970  moreover AOT_have ¬𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
5971  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
5972    AOT_have 𝒜¬([A!]b & ¬q0)
5973      by (metis "Act-Basic:1" "Act-Basic:2" abstract_prop "&E"(1) "∨E"(2)
5974                "≡E"(1) "raa-cor:3")
5975    moreover AOT_have ¬𝒜[E!]b
5976      using b_prop "&E"(2) by blast
5977    ultimately AOT_have 2: 𝒜(¬[E!]b & ¬([A!]b & ¬q0))
5978      by (metis "Act-Basic:2" "Act-Sub:1" "&I" "≡E"(3) "raa-cor:1")
5979    AOT_have 𝒜¬([E!]b  ([A!]b & ¬q0))
5980      by (AOT_subst «¬([E!]b  ([A!]b & ¬q0))» «¬[E!]b & ¬([A!]b & ¬q0)»)
5981         (auto simp: "oth-class-taut:5:d" 2)
5982    AOT_thus ¬𝒜([E!]b  ([A!]b & ¬q0))
5983      by (metis "¬¬I" "Act-Sub:1" "≡E"(4))
5984  next
5985    AOT_show Δ([E!]b  ([A!]b & ¬q0))
5986    proof (rule not_act_and_pos_delta)
5987      AOT_show ¬𝒜([E!]b  ([A!]b & ¬q0))
5988        by (metis "Act-Basic:2" "Act-Basic:9" "∨E"(2) "Conjunction Simplification"(1) "≡E"(4) "modus-tollens:1" not_act_abs_b not_act_concrete_b "raa-cor:3")
5989    next
5990      AOT_show ([E!]b  ([A!]b & ¬q0))
5991        using "KBasic2:2" b_prop "&E"(1) "∨I"(1) "≡E"(3) "raa-cor:3" by blast
5992    qed
5993  next AOT_show 𝒜([E!]a  ([A!]a & ¬q0))
5994      by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_abs_a "&I" "∨I"(2) "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:1")
5995  next AOT_show ¬Δ([E!]a  ([A!]a & ¬q0))
5996    proof (rule act_and_not_nec_not_delta)
5997      AOT_show 𝒜([E!]a  ([A!]a & ¬q0))
5998        by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_abs_a "&I" "∨I"(2) "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:1")
5999    next
6000      AOT_have ¬[E!]a
6001        by (metis "≡dfI" "conventions:5" "&I" "∨I"(2) necessary_or_contingently_false not_act_concrete_a not_delta_concrete_a "raa-cor:3")
6002      moreover AOT_have ¬([A!]a & ¬q0)
6003        by (metis "KBasic2:1" "KBasic:11" "KBasic:3" "&E"(1) "&E"(2) "≡E"(1) q0_prop "raa-cor:3")
6004      ultimately AOT_have (¬[E!]a & ¬([A!]a & ¬q0)) by (metis "KBasic:16" "&I" "vdash-properties:10")
6005      AOT_hence ¬([E!]a  ([A!]a & ¬q0))
6006        by (metis "RE◇" "≡E"(2) "oth-class-taut:5:d")
6007      AOT_thus ¬([E!]a  ([A!]a & ¬q0)) by (metis "KBasic:12" "≡E"(1) "raa-cor:3")
6008    qed
6009  qed
6010  ultimately AOT_obtain F6 where ¬𝒜[F6]b & Δ[F6]b & 𝒜[F6]a & ¬Δ[F6]a
6011    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6012  AOT_hence ¬𝒜[F6]b and Δ[F6]b and 𝒜[F6]a and ¬Δ[F6]a
6013    using "&E" by blast+
6014  note props = props this
6015
6016  let  = "«y [A!]y  [E!]y]»"
6017  AOT_modally_strict {
6018    AOT_have [«»] by "cqt:2[lambda]"
6019  } note 1 = this
6020  moreover AOT_have ¬𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & Δ[«»]a
6021  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6022    AOT_show ¬𝒜([A!]b  [E!]b)
6023      using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_abs_b not_act_concrete_b "raa-cor:3" by blast
6024  next AOT_show Δ([A!]b  [E!]b)
6025    proof (rule not_act_and_pos_delta)
6026      AOT_show ¬𝒜([A!]b  [E!]b)
6027        using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_abs_b not_act_concrete_b "raa-cor:3" by blast
6028    next AOT_show ([A!]b  [E!]b)
6029        using "KBasic2:2" b_prop "&E"(1) "∨I"(2) "≡E"(2) by blast
6030    qed
6031  next AOT_show 𝒜([A!]a  [E!]a)
6032      by (meson "Act-Basic:9" act_abs_a "∨I"(1) "≡E"(2))
6033  next AOT_show Δ([A!]a  [E!]a)
6034    proof (rule nec_delta)
6035      AOT_show ([A!]a  [E!]a)
6036        by (metis "KBasic:15" act_abs_a act_and_not_nec_not_delta "Disjunction Addition"(1) delta_abs_a "raa-cor:3" "vdash-properties:10")
6037    qed
6038  qed
6039  ultimately AOT_obtain F7 where ¬𝒜[F7]b & Δ[F7]b & 𝒜[F7]a & Δ[F7]a
6040    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6041  AOT_hence ¬𝒜[F7]b and Δ[F7]b and 𝒜[F7]a and Δ[F7]a
6042    using "&E" by blast+
6043  note props = props this
6044
6045  let  = "«y [O!]y & ¬[E!]y]»"
6046  AOT_modally_strict {
6047    AOT_have [«»] by "cqt:2[lambda]"
6048  } note 1 = this
6049  moreover AOT_have 𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & ¬Δ[«»]a
6050  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6051    AOT_show 𝒜([O!]b & ¬[E!]b)
6052      by (metis "Act-Basic:1" "Act-Basic:2" act_ord_b "&I" "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:3")
6053  next AOT_show ¬Δ([O!]b & ¬[E!]b)
6054      by (metis (no_types, hide_lams) "conventions:5" "Act-Sub:1" "RM:1" act_and_not_nec_not_delta "act-conj-act:3"
6055                act_ord_b b_prop "&I" "&E"(1) "Conjunction Simplification"(2) "df-rules-formulas[3]"
6056                "≡E"(3) "raa-cor:1" "→E")
6057  next AOT_show ¬𝒜([O!]a & ¬[E!]a)
6058      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_ord_a "raa-cor:3" by blast
6059  next AOT_have ¬([O!]a & ¬[E!]a)
6060      by (metis "KBasic2:3" "&E"(1) "≡E"(4) not_act_ord_a "oa-facts:3" "oa-facts:7" "raa-cor:3" "vdash-properties:10")
6061    AOT_thus ¬Δ([O!]a & ¬[E!]a)
6062      by (rule impossible_delta)
6063  qed      
6064  ultimately AOT_obtain F8 where 𝒜[F8]b & ¬Δ[F8]b & ¬𝒜[F8]a & ¬Δ[F8]a
6065    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6066  AOT_hence 𝒜[F8]b and ¬Δ[F8]b and ¬𝒜[F8]a and ¬Δ[F8]a
6067    using "&E" by blast+
6068  note props = props this
6069
6070  (* TODO_PLM: binary property 9 wrong in PLM *)
6071  let  = "«y ¬[E!]y & ([O!]y  q0)]»"
6072  AOT_modally_strict {
6073    AOT_have [«»] by "cqt:2[lambda]"
6074  } note 1 = this
6075  moreover AOT_have 𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
6076  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6077    AOT_show 𝒜(¬[E!]b & ([O!]b  q0))
6078      by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_ord_b "&I" "∨I"(1)
6079                "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:1")
6080  next AOT_show ¬Δ(¬[E!]b & ([O!]b  q0))
6081    proof (rule act_and_pos_not_not_delta)
6082      AOT_show 𝒜(¬[E!]b & ([O!]b  q0))
6083        by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_ord_b "&I" "∨I"(1)
6084                  "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:1")
6085    next
6086      AOT_show ¬(¬[E!]b & ([O!]b  q0))
6087      proof (AOT_subst «¬(¬[E!]b & ([O!]b  q0))» «[E!]b  ¬([O!]b  q0)»)
6088        AOT_modally_strict {
6089          AOT_show ¬(¬[E!]b & ([O!]b  q0))  [E!]b  ¬([O!]b  q0)
6090            by (metis "&I" "&E"(1) "&E"(2) "∨I"(1) "∨I"(2) "∨E"(2) "deduction-theorem" "≡I" "reductio-aa:1")
6091        }
6092      next
6093        AOT_show ([E!]b  ¬([O!]b  q0))
6094          using "KBasic2:2" b_prop "&E"(1) "∨I"(1) "≡E"(3) "raa-cor:3" by blast
6095       qed
6096     qed
6097   next
6098     AOT_show ¬𝒜(¬[E!]a & ([O!]a  q0))
6099       using "Act-Basic:2" "Act-Basic:9" "&E"(2) "∨E"(3) "≡E"(1) not_act_ord_a not_act_q_zero "reductio-aa:2" by blast
6100   next
6101     AOT_show Δ(¬[E!]a & ([O!]a  q0))
6102     proof (rule not_act_and_pos_delta)
6103       AOT_show ¬𝒜(¬[E!]a & ([O!]a  q0))
6104         by (metis "Act-Basic:2" "Act-Basic:9" "&E"(2) "∨E"(3) "≡E"(1) not_act_ord_a not_act_q_zero "reductio-aa:2")
6105     next
6106       AOT_have ¬[E!]a
6107         using "KBasic2:1" "≡E"(2) not_act_and_pos_delta not_act_concrete_a not_delta_concrete_a "raa-cor:5" by blast
6108       moreover AOT_have ([O!]a  q0)
6109         by (metis "KBasic2:2" "&E"(1) "∨I"(2) "≡E"(3) q0_prop "raa-cor:3")
6110       ultimately AOT_show (¬[E!]a & ([O!]a  q0))
6111         by (metis "KBasic:16" "&I" "vdash-properties:10")
6112     qed
6113   qed
6114  ultimately AOT_obtain F9 where 𝒜[F9]b & ¬Δ[F9]b & ¬𝒜[F9]a & Δ[F9]a
6115    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6116  AOT_hence 𝒜[F9]b and ¬Δ[F9]b and ¬𝒜[F9]a and Δ[F9]a
6117    using "&E" by blast+
6118  note props = props this
6119
6120  AOT_modally_strict {
6121    AOT_have y ¬q0] by "cqt:2[lambda]"
6122  } note 1 = this
6123  moreover AOT_have 𝒜y ¬q0]b & ¬Δy ¬q0]b & 𝒜y ¬q0]a & ¬Δy ¬q0]a
6124    by (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1]; auto simp: act_not_q_zero not_delta_not_q_zero)
6125  ultimately AOT_obtain F10 where 𝒜[F10]b & ¬Δ[F10]b & 𝒜[F10]a & ¬Δ[F10]a
6126    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6127  AOT_hence 𝒜[F10]b and ¬Δ[F10]b and 𝒜[F10]a and ¬Δ[F10]a
6128    using "&E" by blast+
6129  note props = props this
6130
6131  AOT_modally_strict {
6132    AOT_have y ¬[E!]y] by "cqt:2[lambda]"
6133  } note 1 = this
6134  moreover AOT_have 𝒜y ¬[E!]y]b & ¬Δy ¬[E!]y]b & 𝒜y ¬[E!]y]a & Δy ¬[E!]y]a
6135  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6136    AOT_show 𝒜¬[E!]b
6137      using "Act-Basic:1" "∨E"(2) not_act_concrete_b by blast
6138  next AOT_show ¬Δ¬[E!]b
6139      using "≡dfE" "conventions:5" "Act-Basic:1" act_and_not_nec_not_delta b_prop "&E"(1) "∨E"(2) not_act_concrete_b by blast
6140  next AOT_show 𝒜¬[E!]a
6141      using "Act-Basic:1" "∨E"(2) not_act_concrete_a by blast
6142  next AOT_show Δ¬[E!]a
6143      using "KBasic2:1" "≡E"(2) nec_delta not_act_and_pos_delta not_act_concrete_a not_delta_concrete_a "reductio-aa:1" by blast
6144  qed
6145  ultimately AOT_obtain F11 where 𝒜[F11]b & ¬Δ[F11]b & 𝒜[F11]a & Δ[F11]a
6146    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6147  AOT_hence 𝒜[F11]b and ¬Δ[F11]b and 𝒜[F11]a and Δ[F11]a
6148    using "&E" by blast+
6149  note props = props this
6150
6151  AOT_have 𝒜[O!]b & Δ[O!]b & ¬𝒜[O!]a & ¬Δ[O!]a
6152    by (simp add: act_ord_b "&I" delta_ord_b not_act_ord_a not_delta_ord_a)
6153  then AOT_obtain F12 where 𝒜[F12]b & Δ[F12]b & ¬𝒜[F12]a & ¬Δ[F12]a
6154    using "oa-exist:1" "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6155  AOT_hence 𝒜[F12]b and Δ[F12]b and ¬𝒜[F12]a and ¬Δ[F12]a
6156    using "&E" by blast+
6157  note props = props this
6158
6159  let  = "«y [O!]y  q0]»"
6160  AOT_modally_strict {
6161    AOT_have [«»] by "cqt:2[lambda]"
6162  } note 1 = this
6163  moreover AOT_have 𝒜[«»]b & Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
6164  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6165    AOT_show 𝒜([O!]b  q0)
6166      by (meson "Act-Basic:9" act_ord_b "∨I"(1) "≡E"(2))
6167  next AOT_show Δ([O!]b  q0)
6168      by (meson "KBasic:15" b_ord "∨I"(1) nec_delta "oa-facts:1" "vdash-properties:10")
6169  next AOT_show ¬𝒜([O!]a  q0)
6170      using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_ord_a not_act_q_zero "raa-cor:3" by blast
6171  next AOT_show Δ([O!]a  q0)
6172    proof (rule not_act_and_pos_delta)
6173      AOT_show ¬𝒜([O!]a  q0)
6174        using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_ord_a not_act_q_zero "raa-cor:3" by blast
6175    next AOT_show ([O!]a  q0)
6176        using "KBasic2:2" "&E"(1) "∨I"(2) "≡E"(2) q0_prop by blast
6177    qed
6178  qed
6179  ultimately AOT_obtain F13 where 𝒜[F13]b & Δ[F13]b & ¬𝒜[F13]a & Δ[F13]a
6180    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6181  AOT_hence 𝒜[F13]b and Δ[F13]b and ¬𝒜[F13]a and Δ[F13]a
6182    using "&E" by blast+
6183  note props = props this
6184
6185  let  = "«y [O!]y  ¬q0]»"
6186  AOT_modally_strict {
6187     AOT_have [«»] by "cqt:2[lambda]"
6188  } note 1 = this
6189  moreover AOT_have 𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6190  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6191    AOT_show 𝒜([O!]b  ¬q0)
6192      by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6193  next AOT_show Δ([O!]b  ¬q0)
6194      by (meson "KBasic:15" b_ord "∨I"(1) nec_delta "oa-facts:1" "vdash-properties:10")
6195  next AOT_show 𝒜([O!]a  ¬q0)
6196      by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6197  next AOT_show ¬Δ([O!]a  ¬q0)
6198    proof(rule act_and_pos_not_not_delta)
6199      AOT_show 𝒜([O!]a  ¬q0)
6200        by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6201    next
6202      AOT_have ¬[O!]a
6203        using "KBasic2:1" "≡E"(2) not_act_and_pos_delta not_act_ord_a not_delta_ord_a "raa-cor:6" by blast
6204      moreover AOT_have q0
6205        by (meson "&E"(1) q0_prop)
6206      ultimately AOT_have 2: (¬[O!]a & q0)
6207         by (metis "KBasic:16" "&I" "vdash-properties:10")
6208      AOT_show ¬([O!]a  ¬q0)
6209      proof (AOT_subst_rev «¬[O!]a & q0» «¬([O!]a  ¬q0)»)
6210        AOT_modally_strict {
6211          AOT_show ¬[O!]a & q0  ¬([O!]a  ¬q0)
6212            by (metis "&I" "&E"(1) "&E"(2) "∨I"(1) "∨I"(2)
6213                      "∨E"(3) "deduction-theorem" "≡I" "raa-cor:3")
6214        }
6215      next
6216        AOT_show (¬[O!]a & q0)
6217          using "2" by blast
6218      qed
6219    qed
6220  qed
6221  ultimately AOT_obtain F14 where 𝒜[F14]b & Δ[F14]b & 𝒜[F14]a & ¬Δ[F14]a
6222    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6223  AOT_hence 𝒜[F14]b and Δ[F14]b and 𝒜[F14]a and ¬Δ[F14]a
6224    using "&E" by blast+
6225  note props = props this
6226
6227  AOT_have [L]
6228    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
6229  moreover AOT_have 𝒜[L]b & Δ[L]b & 𝒜[L]a & Δ[L]a
6230  proof (safe intro!: "&I")
6231    AOT_show 𝒜[L]b
6232      by (meson nec_L "nec-imp-act" "vdash-properties:10")
6233    next AOT_show Δ[L]b using nec_L nec_delta by blast
6234    next AOT_show 𝒜[L]a by (meson nec_L "nec-imp-act" "vdash-properties:10")
6235    next AOT_show Δ[L]a using nec_L nec_delta by blast
6236  qed
6237  ultimately AOT_obtain F15 where 𝒜[F15]b & Δ[F15]b & 𝒜[F15]a & Δ[F15]a
6238    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6239  AOT_hence 𝒜[F15]b and Δ[F15]b and 𝒜[F15]a and Δ[F15]a
6240    using "&E" by blast+
6241  note props = props this
6242
6243  show ?thesis
6244    by (rule "∃I"(2)[where β=F0]; rule "∃I"(2)[where β=F1]; rule "∃I"(2)[where β=F2];
6245           rule "∃I"(2)[where β=F3]; rule "∃I"(2)[where β=F4]; rule "∃I"(2)[where β=F5];
6246           rule "∃I"(2)[where β=F6]; rule "∃I"(2)[where β=F7]; rule "∃I"(2)[where β=F8];
6247           rule "∃I"(2)[where β=F9]; rule "∃I"(2)[where β=F10]; rule "∃I"(2)[where β=F11];
6248           rule "∃I"(2)[where β=F12]; rule "∃I"(2)[where β=F13]; rule "∃I"(2)[where β=F14];
6249           rule "∃I"(2)[where β=F15]; safe intro!: "&I")
6250       (match conclusion in "[?v  [F]  [G]]" for F G  6251        match props in A: "[?v  ¬φ{F}]" for φ 6252        match (φ) in "λa . ?p" fail¦ "λa . a" fail¦ _ 6253        match props in B: "[?v  φ{G}]" 6254        fact "pos-not-equiv-ne:4"[where F=F and G=G and φ=φ, THEN "→E",
6255                                OF "oth-class-taut:4:h"[THEN "≡E"(2)],
6256                                OF "Disjunction Addition"(2)[THEN "→E"],
6257                                OF "&I", OF A, OF B]››››)+
6258qed
6259
6260AOT_theorem "o-objects-exist:1": x O!x
6261proof(rule RN)
6262  AOT_modally_strict {
6263    AOT_obtain a where (E!a & ¬𝒜[E!]a)
6264      using "∃E"[rotated, OF "qml:4"[axiom_inst, THEN "BF◇"[THEN "→E"]]] by blast
6265    AOT_hence 1: E!a by (metis "KBasic2:3" "&E"(1) "→E")
6266    AOT_have x [E!]x]a
6267    proof (rule "β←C"(1); "cqt:2[lambda]"?)
6268      AOT_show a using "cqt:2[const_var]"[axiom_inst] by blast
6269    next
6270      AOT_show E!a by (fact 1)
6271    qed
6272    AOT_hence O!a by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
6273    AOT_thus x [O!]x by (rule "∃I")
6274  }
6275qed
6276
6277AOT_theorem "o-objects-exist:2": x A!x
6278proof (rule RN)
6279  AOT_modally_strict {
6280    AOT_obtain a where [A!]a
6281      using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
6282    AOT_thus x A!x using "∃I" by blast
6283  }
6284qed
6285
6286AOT_theorem "o-objects-exist:3": ¬x O!x
6287  by (rule RN) (metis (no_types, hide_lams) "∃E" "cqt-orig:1[const_var]" "≡E"(4) "modus-tollens:1" "o-objects-exist:2" "oa-contingent:2" "qml:2"[axiom_inst] "reductio-aa:2")
6288
6289AOT_theorem "o-objects-exist:4": ¬x A!x
6290  by (rule RN) (metis (mono_tags, hide_lams) "∃E" "cqt-orig:1[const_var]" "≡E"(1) "modus-tollens:1" "o-objects-exist:1" "oa-contingent:2" "qml:2"[axiom_inst] "→E")
6291
6292AOT_theorem "o-objects-exist:5": ¬x E!x
6293proof (rule RN; rule "raa-cor:2")
6294  AOT_modally_strict {
6295    AOT_assume x E!x
6296    moreover AOT_obtain a where abs: A!a
6297      using "o-objects-exist:2"[THEN "qml:2"[axiom_inst, THEN "→E"]] "∃E"[rotated] by blast
6298    ultimately AOT_have E!a using "∀E" by blast
6299    AOT_hence 1: E!a by (metis "T◇" "→E")
6300    AOT_have y E!y]a
6301    proof (rule "β←C"(1); "cqt:2[lambda]"?)
6302      AOT_show a using "cqt:2[const_var]"[axiom_inst].
6303    next
6304      AOT_show E!a by (fact 1)
6305    qed
6306    AOT_hence O!a
6307      by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
6308    AOT_hence ¬A!a by (metis "≡E"(1) "oa-contingent:2") 
6309    AOT_thus p & ¬p for p using abs by (metis "raa-cor:3")
6310  }
6311qed
6312
6313AOT_theorem partition: ¬x (O!x & A!x)
6314proof(rule "raa-cor:2")
6315  AOT_assume x (O!x & A!x)
6316  then AOT_obtain a where O!a & A!a using "∃E"[rotated] by blast
6317  AOT_thus p & ¬p for p by (metis "&E"(1) "Conjunction Simplification"(2) "≡E"(1) "modus-tollens:1" "oa-contingent:2" "raa-cor:3")
6318qed
6319
6320AOT_define eq_E :: ‹Π› ("'(=E')") "=E": (=E) =df xy O!x & O!y & F ([F]x  [F]y)]
6321
6322syntax "_AOT_eq_E_infix" :: ‹τ  τ  φ› (infixl "=E" 50)
6323translations
6324  "_AOT_eq_E_infix κ κ'" == "CONST AOT_exe (CONST eq_E) (CONST Pair κ κ')"
6325(* TODO: try to replace by a simple translations pattern *)
6326print_translation6327AOT_syntax_print_translations
6328[(const_syntax‹AOT_exe›, fn ctxt => fn [
6329  Const ("constAOT_PLM.eq_E", _),
6330  Const (const_syntax‹Pair›, _) $ lhs $ rhs
6331] => Const (syntax_const‹_AOT_eq_E_infix›, dummyT) $ lhs $ rhs)]
6332
6333text‹Note: Not explicitly mentioned as theorem in PLM.›
6334AOT_theorem "=E[denotes]": [(=E)]
6335  by (rule "=dfI"(2)[OF "=E"]) "cqt:2[lambda]"+
6336
6337AOT_theorem "=E-simple:1": x =E y  (O!x & O!y & F ([F]x  [F]y))
6338proof -
6339  (* TODO: rethink the product hacks *)
6340  AOT_have 0: «(AOT_term_of_var x,AOT_term_of_var y)»
6341    by (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6342  AOT_have 1: xy [O!]x & [O!]y & F ([F]x  [F]y)] by "cqt:2[lambda]"
6343  show ?thesis apply (rule "=dfI"(2)[OF "=E"]; "cqt:2[lambda]"?)
6344    using "beta-C-meta"[THEN "→E", OF 1, unvarify ν1νn, of "(AOT_term_of_var x,AOT_term_of_var y)", OF 0]
6345    by fast
6346qed
6347
6348AOT_theorem "=E-simple:2": x =E y  x = y
6349proof (rule "→I")
6350  AOT_assume x =E y
6351  AOT_hence O!x & O!y & F ([F]x  [F]y) using "=E-simple:1"[THEN "≡E"(1)] by blast
6352  AOT_thus x = y
6353    using "≡dfI"[OF "identity:1"] "∨I" by blast
6354qed
6355
6356AOT_theorem "id-nec3:1": x =E y  (x =E y)
6357proof (rule "≡I"; rule "→I")
6358  AOT_assume x =E y
6359  AOT_hence O!x & O!y & F ([F]x  [F]y)
6360    using "=E-simple:1" "≡E" by blast
6361  AOT_hence O!x & O!y & F ([F]x  [F]y)
6362    by (metis "S5Basic:6" "&I" "&E"(1) "&E"(2) "≡E"(4) "oa-facts:1" "raa-cor:3" "vdash-properties:10")
6363  AOT_hence 1: (O!x & O!y & F ([F]x  [F]y))
6364    by (metis "&E"(1) "&E"(2) "≡E"(2) "KBasic:3" "&I")
6365  AOT_show (x =E y)
6366    apply (AOT_subst «x =E y» «O!x & O!y & F ([F]x  [F]y)»)
6367     using "=E-simple:1" apply presburger
6368    by (simp add: "1")
6369next
6370  AOT_assume (x =E y)
6371  AOT_thus x =E y using "qml:2"[axiom_inst, THEN "→E"] by blast
6372qed
6373
6374AOT_theorem "id-nec3:2": (x =E y)  x =E y
6375  by (meson "RE◇" "S5Basic:2" "id-nec3:1" "≡E"(1) "≡E"(5) "Commutativity of ≡")
6376
6377AOT_theorem "id-nec3:3": (x =E y)  (x =E y)
6378  by (meson "id-nec3:1" "id-nec3:2" "≡E"(5))
6379
6380syntax "_AOT_non_eq_E" :: ‹Π› ("'(≠E')")
6381translations
6382  (Π) "(≠E)" == (Π) "(=E)-"
6383syntax "_AOT_non_eq_E_infix" :: ‹τ  τ  φ› (infixl "E" 50)
6384translations
6385 "_AOT_non_eq_E_infix κ κ'" == "CONST AOT_exe (CONST relation_negation (CONST eq_E)) (CONST Pair κ κ')"
6386(* TODO: try replacing be a simple translations pattern *)
6387print_translation6388AOT_syntax_print_translations
6389[(const_syntax‹AOT_exe›, fn ctxt => fn [
6390  Const (const_syntax‹relation_negation›, _) $ Const ("constAOT_PLM.eq_E", _),
6391  Const (const_syntax‹Pair›, _) $ lhs $ rhs
6392] => Const (syntax_const‹_AOT_non_eq_E_infix›, dummyT) $ lhs $ rhs)]
6393AOT_theorem "thm-neg=E": x E y  ¬(x =E y)
6394proof -
6395  (* TODO: rethink the product hacks *)
6396  AOT_have 0: «(AOT_term_of_var x,AOT_term_of_var y)»
6397    by (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6398  AOT_have θ: x1...x2 ¬(=E)x1...x2] by "cqt:2[lambda]" (* TODO_PLM: convoluted proof in PLM; TODO: product hack *)
6399  AOT_have x E y  x1...x2 ¬(=E)x1...x2]xy
6400    by (rule "=dfI"(1)[OF "df-relation-negation", OF θ])
6401       (meson "oth-class-taut:3:a")
6402  also AOT_have   ¬(=E)xy
6403    apply (rule "beta-C-meta"[THEN "→E", unvarify ν1νn])
6404     apply "cqt:2[lambda]"
6405    by (fact 0)
6406  finally show ?thesis.
6407qed
6408
6409AOT_theorem "id-nec4:1": x E y  (x E y)
6410proof -
6411  AOT_have x E y  ¬(x =E y) using "thm-neg=E".
6412  also AOT_have   ¬(x =E y)
6413    by (meson "id-nec3:2" "≡E"(1) "Commutativity of ≡" "oth-class-taut:4:b")
6414  also AOT_have   ¬(x =E y)
6415    by (meson "KBasic2:1" "≡E"(2) "Commutativity of ≡")
6416  also AOT_have   (x E y)
6417    by (AOT_subst_rev "«x E y»" "«¬(x =E y)»")
6418       (auto simp: "thm-neg=E" "oth-class-taut:3:a")
6419  finally show ?thesis.
6420qed
6421
6422AOT_theorem "id-nec4:2": (x E y)  (x E y)
6423  by (meson "RE◇" "S5Basic:2" "id-nec4:1" "≡E"(2) "≡E"(5) "Commutativity of ≡")
6424
6425AOT_theorem "id-nec4:3": (x E y)  (x E y)
6426  by (meson "id-nec4:1" "id-nec4:2" "≡E"(5))
6427
6428AOT_theorem "id-act2:1": x =E y  𝒜x =E y
6429  by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "id-nec3:2" "≡E"(1) "≡E"(6))
6430AOT_theorem "id-act2:2": x E y  𝒜x E y
6431  by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "id-nec4:2" "≡E"(1) "≡E"(6))
6432
6433AOT_theorem "ord=Eequiv:1": O!x  x =E x
6434proof (rule "→I")
6435  AOT_assume 1: O!x
6436  AOT_show x =E x
6437    apply (rule "=dfI"(2)[OF "=E"]) apply "cqt:2[lambda]"
6438    apply (rule "β←C"(1))
6439      apply "cqt:2[lambda]"
6440     apply (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6441    by (simp add: "1" RN "&I" "oth-class-taut:3:a" "universal-cor")
6442qed
6443
6444AOT_theorem "ord=Eequiv:2": x =E y  y =E x
6445proof(rule CP)
6446  AOT_assume 1: x =E y
6447  AOT_hence 2: x = y by (metis "=E-simple:2" "vdash-properties:10") 
6448  AOT_have O!x using 1 by (meson "&E"(1) "=E-simple:1" "≡E"(1))
6449  AOT_hence x =E x using "ord=Eequiv:1" "→E" by blast
6450  AOT_thus y =E x using "rule=E"[rotated, OF 2] by fast
6451qed
6452
6453AOT_theorem "ord=Eequiv:3": (x =E y & y =E z)  x =E z
6454proof (rule CP)
6455  AOT_assume 1: x =E y & y =E z
6456  AOT_hence x = y & y = z
6457    by (metis "&I" "&E"(1) "&E"(2) "=E-simple:2" "vdash-properties:6")
6458  AOT_hence x = z by (metis "id-eq:3" "vdash-properties:6")
6459  moreover AOT_have x =E x
6460    using 1[THEN "&E"(1)] "&E"(1) "=E-simple:1" "≡E"(1) "ord=Eequiv:1" "→E" by blast
6461  ultimately AOT_show x =E z
6462    using "rule=E" by fast
6463qed
6464
6465AOT_theorem "ord-=E=:1": (O!x  O!y)  (x = y  x =E y)
6466proof(rule CP)
6467  AOT_assume O!x  O!y
6468  moreover {
6469    AOT_assume O!x
6470    AOT_hence O!x by (metis "oa-facts:1" "vdash-properties:10")
6471    moreover {
6472      AOT_modally_strict {
6473        AOT_have O!x  (x = y  x =E y)
6474        proof (rule "→I"; rule "≡I"; rule "→I")
6475          AOT_assume O!x
6476          AOT_hence x =E x by (metis "ord=Eequiv:1" "→E")
6477          moreover AOT_assume x = y
6478          ultimately AOT_show x =E y using "rule=E" by fast
6479        next
6480          AOT_assume x =E y
6481          AOT_thus x = y by (metis "=E-simple:2" "→E")
6482        qed
6483      }
6484      AOT_hence O!x  (x = y  x =E y) by (metis "RM:1")
6485    }
6486    ultimately AOT_have (x = y  x =E y) using "→E" by blast
6487  }
6488  moreover {
6489    AOT_assume O!y
6490    AOT_hence O!y by (metis "oa-facts:1" "vdash-properties:10")
6491    moreover {
6492      AOT_modally_strict {
6493        AOT_have O!y  (x = y  x =E y)
6494        proof (rule "→I"; rule "≡I"; rule "→I")
6495          AOT_assume O!y
6496          AOT_hence y =E y by (metis "ord=Eequiv:1" "→E")
6497          moreover AOT_assume x = y
6498          ultimately AOT_show x =E y using "rule=E" id_sym by fast
6499        next
6500          AOT_assume x =E y
6501          AOT_thus x = y by (metis "=E-simple:2" "→E")
6502        qed
6503      }
6504      AOT_hence O!y  (x = y  x =E y) by (metis "RM:1")
6505    }
6506    ultimately AOT_have (x = y  x =E y) using "→E" by blast
6507  }
6508  ultimately AOT_show (x = y  x =E y) by (metis "∨E"(3) "raa-cor:1")
6509qed
6510
6511AOT_theorem "ord-=E=:2": O!y  x x = y]
6512proof (rule "→I"; rule "safe-ext"[axiom_inst, THEN "→E"]; rule "&I")
6513  AOT_show x x =E y] by "cqt:2[lambda]"
6514next
6515  AOT_assume O!y
6516  AOT_hence 1: (x = y  x =E y) for x using "ord-=E=:1" "→E" "∨I" by blast
6517  AOT_have (x =E y  x = y) for x
6518    by (AOT_subst «x =E y  x = y» «x = y  x =E y»)
6519       (auto simp add: "Commutativity of ≡" 1)
6520  AOT_hence x (x =E y  x = y) by (rule GEN)
6521  AOT_thus x (x =E y  x = y) by (rule BF[THEN "→E"])
6522qed
6523
6524
6525AOT_theorem "ord-=E=:3": xy O!x & O!y & x = y]
6526proof (rule "safe-ext[2]"[axiom_inst, THEN "→E"]; rule "&I")
6527  AOT_show xy O!x & O!y & x =E y] by "cqt:2[lambda]"
6528next
6529  AOT_show xy ([O!]x & [O!]y & x =E y  [O!]x & [O!]y & x = y)
6530  proof (rule RN; rule GEN; rule GEN; rule "≡I"; rule "→I")
6531    AOT_modally_strict {
6532      AOT_show [O!]x & [O!]y & x = y if [O!]x & [O!]y & x =E y for x y
6533        by (metis "&I" "&E"(1) "Conjunction Simplification"(2) "=E-simple:2"
6534                  "modus-tollens:1" "raa-cor:1" that)
6535    }
6536  next
6537    AOT_modally_strict {
6538      AOT_show [O!]x & [O!]y & x =E y if [O!]x & [O!]y & x = y for x y
6539        apply(safe intro!: "&I")
6540          apply (metis that[THEN "&E"(1), THEN "&E"(1)])
6541         apply (metis that[THEN "&E"(1), THEN "&E"(2)])
6542        using "rule=E"[rotated, OF that[THEN "&E"(2)]]
6543              "ord=Eequiv:1"[THEN "→E", OF that[THEN "&E"(1), THEN "&E"(1)]] by fast
6544    }
6545  qed
6546qed
6547
6548AOT_theorem "ind-nec": F ([F]x  [F]y)  F ([F]x  [F]y)
6549proof(rule "→I")
6550  AOT_assume F ([F]x  [F]y)
6551  moreover AOT_have x F ([F]x  [F]y)] by "cqt:2[lambda]"
6552  ultimately AOT_have x F ([F]x  [F]y)]x  x F ([F]x  [F]y)]y
6553    using "∀E" by blast
6554  moreover AOT_have x F ([F]x  [F]y)]y
6555    apply (rule "β←C"(1))
6556      apply "cqt:2[lambda]"
6557     apply (fact "cqt:2[const_var]"[axiom_inst])
6558    by (simp add: RN GEN "oth-class-taut:3:a")
6559  ultimately AOT_have x F ([F]x  [F]y)]x using "≡E" by blast
6560  AOT_thus F ([F]x  [F]y)
6561    using "β→C"(1) by blast
6562qed
6563
6564AOT_theorem "ord=E:1": (O!x & O!y)  (F ([F]x  [F]y)  x =E y)
6565proof (rule "→I"; rule "→I")
6566  AOT_assume F ([F]x  [F]y)
6567  AOT_hence F ([F]x  [F]y)
6568    using "ind-nec"[THEN "→E"] by blast
6569  moreover AOT_assume O!x & O!y
6570  ultimately AOT_have O!x & O!y & F ([F]x  [F]y)
6571    using "&I" by blast
6572  AOT_thus x =E y using "=E-simple:1"[THEN "≡E"(2)] by blast
6573qed
6574
6575AOT_theorem "ord=E:2": (O!x & O!y)  (F ([F]x  [F]y)  x = y)
6576proof (rule "→I"; rule "→I")
6577  AOT_assume O!x & O!y
6578  moreover AOT_assume F ([F]x  [F]y)
6579  ultimately AOT_have x =E y
6580    using "ord=E:1" "→E" by blast
6581  AOT_thus x = y using "=E-simple:2"[THEN "→E"] by blast
6582qed
6583
6584AOT_theorem "ord=E2:1": (O!x & O!y)  (x  y  z z =E x]  z z =E y])
6585proof (rule "→I"; rule "≡I"; rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6586  AOT_assume 0: O!x & O!y
6587  AOT_assume x  y
6588  AOT_hence 1: ¬(x = y) using "≡dfE"[OF "=-infix"] by blast
6589  AOT_assume z z =E x] = z z =E y]
6590  moreover AOT_have z z =E x]x
6591    apply (rule "β←C"(1))
6592      apply "cqt:2[lambda]"
6593     apply (fact "cqt:2[const_var]"[axiom_inst])
6594    using "ord=Eequiv:1"[THEN "→E", OF 0[THEN "&E"(1)]].
6595  ultimately AOT_have z z =E y]x using "rule=E" by fast
6596  AOT_hence x =E y using "β→C"(1) by blast
6597  AOT_hence x = y by (metis "=E-simple:2" "vdash-properties:6")
6598  AOT_thus x = y & ¬(x = y) using 1 "&I" by blast
6599next
6600  AOT_assume z z =E x]  z z =E y]
6601  AOT_hence 0: ¬(z z =E x] = z z =E y]) using "≡dfE"[OF "=-infix"] by blast
6602  AOT_have z z =E x] by "cqt:2[lambda]"
6603  AOT_hence z z =E x] = z z =E x]
6604    by (metis "rule=I:1")
6605  moreover AOT_assume x = y
6606  ultimately AOT_have z z =E x] = z z =E y]
6607    using "rule=E" by fast
6608  AOT_thus z z =E x] = z z =E y] & ¬(z z =E x] = z z =E y])
6609    using 0 "&I" by blast
6610qed
6611
6612AOT_theorem "ord=E2:2": (O!x & O!y)  (x  y  z z = x]  z z = y])
6613proof (rule "→I"; rule "≡I"; rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6614  AOT_assume 0: O!x & O!y
6615  AOT_assume x  y
6616  AOT_hence 1: ¬(x = y) using "≡dfE"[OF "=-infix"] by blast
6617  AOT_assume z z = x] = z z = y]
6618  moreover AOT_have z z = x]x
6619    apply (rule "β←C"(1))
6620    apply (fact "ord-=E=:2"[THEN "→E", OF 0[THEN "&E"(1)]])
6621     apply (fact "cqt:2[const_var]"[axiom_inst])
6622    by (simp add: "id-eq:1")
6623  ultimately AOT_have z z = y]x using "rule=E" by fast
6624  AOT_hence x = y using "β→C"(1) by blast
6625  AOT_thus x = y & ¬(x = y) using 1 "&I" by blast
6626next
6627  AOT_assume 0: O!x & O!y
6628  AOT_assume z z = x]  z z = y]
6629  AOT_hence 1: ¬(z z = x] = z z = y]) using "≡dfE"[OF "=-infix"] by blast
6630  AOT_have z z = x] by (fact "ord-=E=:2"[THEN "→E", OF 0[THEN "&E"(1)]])
6631  AOT_hence z z = x] = z z = x]
6632    by (metis "rule=I:1")
6633  moreover AOT_assume x = y
6634  ultimately AOT_have z z = x] = z z = y]
6635    using "rule=E" by fast
6636  AOT_thus z z = x] = z z = y] & ¬(z z = x] = z z = y])
6637    using 1 "&I" by blast
6638qed
6639
6640AOT_theorem ordnecfail: O!x  ¬F x[F]
6641  by (meson "RM:1" "deduction-theorem" nocoder "oa-facts:1" "vdash-properties:10" "vdash-properties:1[2]")
6642
6643AOT_theorem "ab-obey:1": (A!x & A!y)  (F (x[F]  y[F])  x = y)
6644proof (rule "→I"; rule "→I")
6645  AOT_assume 1: A!x & A!y
6646  AOT_assume F (x[F]  y[F])
6647  AOT_hence x[F]  y[F] for F using "∀E" by blast
6648  AOT_hence (x[F]  y[F]) for F by (metis "en-eq:6[1]" "≡E"(1))
6649  AOT_hence F (x[F]  y[F]) by (rule GEN)
6650  AOT_hence F (x[F]  y[F]) by (rule BF[THEN "→E"])
6651  AOT_thus x = y
6652    using "≡dfI"[OF "identity:1", OF "∨I"(2)] 1 "&I" by blast
6653qed
6654
6655AOT_theorem "ab-obey:2": (F (x[F] & ¬y[F])  F (y[F] & ¬x[F]))  x  y
6656proof (rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6657  AOT_assume 1: x = y
6658  AOT_assume F (x[F] & ¬y[F])  F (y[F] & ¬x[F])
6659  moreover {
6660    AOT_assume F (x[F] & ¬y[F])
6661    then AOT_obtain F where x[F] & ¬y[F] using "∃E"[rotated] by blast
6662    moreover AOT_have y[F] using calculation[THEN "&E"(1)] 1 "rule=E" by fast
6663    ultimately AOT_have p & ¬p for p by (metis "Conjunction Simplification"(2) "modus-tollens:2" "raa-cor:3")
6664  }
6665  moreover {
6666    AOT_assume F (y[F] & ¬x[F])
6667    then AOT_obtain F where y[F] & ¬x[F] using "∃E"[rotated] by blast
6668    moreover AOT_have ¬y[F] using calculation[THEN "&E"(2)] 1 "rule=E" by fast
6669    ultimately AOT_have p & ¬p for p by (metis "Conjunction Simplification"(1) "modus-tollens:1" "raa-cor:3")
6670  }
6671  ultimately AOT_show p & ¬p for p by (metis "∨E"(3) "raa-cor:1")
6672qed
6673
6674AOT_theorem "encoders-are-abstract": F x[F]  A!x
6675  by (meson "deduction-theorem" "≡E"(2) "modus-tollens:2" nocoder
6676            "oa-contingent:3" "vdash-properties:1[2]")
6677
6678AOT_theorem "denote=:1": Hx x[H]
6679  by (rule GEN; rule "existence:2[1]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6680
6681AOT_theorem "denote=:2": Gx1...∃xn x1...xn[H]
6682  by (rule GEN; rule "existence:2"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6683
6684AOT_theorem "denote=:2[2]": Gx1x2 x1x2[H]
6685  by (rule GEN; rule "existence:2[2]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6686
6687AOT_theorem "denote=:2[3]": Gx1x2x3 x1x2x3[H]
6688  by (rule GEN; rule "existence:2[3]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6689
6690AOT_theorem "denote=:2[4]": Gx1x2x3x4 x1x2x3x4[H]
6691  by (rule GEN; rule "existence:2[4]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6692
6693AOT_theorem "denote=:3": x x[Π]  H (H = Π)
6694  using "existence:2[1]" "free-thms:1" "≡E"(2) "≡E"(5) "Commutativity of ≡" "≡Df" by blast
6695
6696AOT_theorem "denote=:4": (x1...∃xn x1...xn[Π])  H (H = Π)
6697  using "existence:2" "free-thms:1" "≡E"(6) "≡Df" by blast
6698
6699AOT_theorem "denote=:4[2]": (x1x2 x1x2[Π])  H (H = Π)
6700  using "existence:2[2]" "free-thms:1" "≡E"(6) "≡Df" by blast
6701
6702AOT_theorem "denote=:4[3]": (x1x2x3 x1x2x3[Π])  H (H = Π)
6703  using "existence:2[3]" "free-thms:1" "≡E"(6) "≡Df" by blast
6704
6705AOT_theorem "denote=:4[4]": (x1x2x3x4 x1x2x3x4[Π])  H (H = Π)
6706  using "existence:2[4]" "free-thms:1" "≡E"(6) "≡Df" by blast
6707
6708AOT_theorem "A-objects!": ∃!x (A!x & F (x[F]  φ{F}))
6709proof (rule "uniqueness:1"[THEN "≡dfI"])
6710  AOT_obtain a where a_prop: A!a & F (a[F]  φ{F})
6711    using "A-objects"[axiom_inst] "∃E"[rotated] by blast
6712  AOT_have (A!β & F (β[F]  φ{F}))  β = a for β
6713  proof (rule "→I")
6714    AOT_assume β_prop: [A!]β & F (β[F]  φ{F})
6715    AOT_hence β[F]  φ{F} for F using "∀E" "&E" by blast
6716    AOT_hence β[F]  a[F] for F
6717      using a_prop[THEN "&E"(2)] "∀E" "≡E"(2) "≡E"(5) "Commutativity of ≡" by fast
6718    AOT_hence F (β[F]  a[F]) by (rule GEN)
6719    AOT_thus β = a
6720      using "ab-obey:1"[THEN "→E", OF "&I"[OF β_prop[THEN "&E"(1)], OF a_prop[THEN "&E"(1)]], THEN "→E"] by blast
6721  qed
6722  AOT_hence β ((A!β & F (β[F]  φ{F}))  β = a) by (rule GEN)
6723  AOT_thus α ([A!]α & F (α[F]  φ{F}) & β ([A!]β & F (β[F]  φ{F})  β = α))
6724    using "∃I" using a_prop "&I" by fast
6725qed
6726
6727AOT_theorem "obj-oth:1": ∃!x (A!x & F (x[F]  [F]y))
6728  using "A-objects!" by fast
6729
6730AOT_theorem "obj-oth:2": ∃!x (A!x & F (x[F]  [F]y & [F]z))
6731  using "A-objects!" by fast
6732
6733AOT_theorem "obj-oth:3": ∃!x (A!x & F (x[F]  [F]y  [F]z))
6734  using "A-objects!" by fast
6735
6736AOT_theorem "obj-oth:4": ∃!x (A!x & F (x[F]  [F]y))
6737  using "A-objects!" by fast
6738
6739AOT_theorem "obj-oth:5": ∃!x (A!x & F (x[F]  F = G))
6740  using "A-objects!" by fast
6741
6742AOT_theorem "obj-oth:6": ∃!x (A!x & F (x[F]  y([G]y  [F]y)))
6743  using "A-objects!" by fast
6744
6745AOT_theorem "A-descriptions": ιx (A!x & F (x[F]  φ{F}))
6746  by (rule "A-Exists:2"[THEN "≡E"(2)]; rule "RA[2]"; rule "A-objects!")
6747
6748AOT_act_theorem "thm-can-terms2": y = ιx(A!x & F (x[F]  φ{F}))  (A!y & F (y[F]  φ{F}))
6749  using "y-in:2" by blast
6750
6751AOT_theorem "can-ab2": y = ιx(A!x & F (x[F]  φ{F}))   A!y
6752proof(rule "→I")
6753  AOT_assume y = ιx(A!x & F (x[F]  φ{F}))
6754  AOT_hence 𝒜(A!y & F (y[F]  φ{F}))
6755    using "actual-desc:2"[THEN "→E"] by blast
6756  AOT_hence 𝒜A!y by (metis "Act-Basic:2" "&E"(1) "≡E"(1))
6757  AOT_thus A!y by (metis "≡E"(2) "oa-facts:8")
6758qed
6759
6760AOT_act_theorem "desc-encode": ιx(A!x & F (x[F]  φ{F}))[G]  φ{G}
6761proof -
6762  AOT_have ιx(A!x & F (x[F]  φ{F}))
6763    by (simp add: "A-descriptions")
6764  AOT_hence A!ιx(A!x & F (x[F]  φ{F})) & F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6765    using "y-in:3"[THEN "→E"] by blast
6766  AOT_thus ιx(A!x & F (x[F]  φ{F}))[G]  φ{G}
6767    using "&E" "∀E" by blast
6768qed
6769
6770AOT_theorem "desc-nec-encode": ιx (A!x & F (x[F]  φ{F}))[G]  𝒜φ{G}
6771proof -
6772  AOT_have 0: ιx(A!x & F (x[F]  φ{F}))
6773    by (simp add: "A-descriptions")
6774  AOT_hence 𝒜(A!ιx(A!x & F (x[F]  φ{F})) & F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}))
6775    using "actual-desc:4"[THEN "→E"] by blast
6776  AOT_hence 𝒜F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6777    using "Act-Basic:2" "&E"(2) "≡E"(1) by blast
6778  AOT_hence F 𝒜(ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6779    using "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]" by blast
6780  AOT_hence 𝒜(ιx(A!x & F (x[F]  φ{F}))[G]  φ{G})
6781    using "∀E" by blast
6782  AOT_hence 𝒜ιx(A!x & F (x[F]  φ{F}))[G]  𝒜φ{G}
6783    using "Act-Basic:5" "≡E"(1) by blast
6784  AOT_thus ιx(A!x & F (x[F]  φ{F}))[G]  𝒜φ{G}
6785    using "en-eq:10[1]"[unvarify x1, OF 0] "≡E"(6) by blast
6786qed
6787
6788AOT_theorem "Box-desc-encode:1": φ{G}  ιx(A!x & F (x[F]  φ{G}))[G]
6789  by (rule "→I"; rule "desc-nec-encode"[THEN "≡E"(2)])
6790     (meson "nec-imp-act" "vdash-properties:10")
6791
6792AOT_theorem "Box-desc-encode:2": φ{G}  (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G})
6793proof(rule CP)
6794  AOT_assume φ{G}
6795  AOT_hence φ{G} by (metis "S5Basic:6" "≡E"(1))
6796  moreover AOT_have φ{G}  (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G})
6797  proof (rule RM; rule "→I")
6798    AOT_modally_strict {
6799      AOT_assume 1: φ{G}
6800      AOT_hence ιx(A!x & F (x[F]  φ{G}))[G] using "Box-desc-encode:1" "→E" by blast
6801      moreover AOT_have φ{G} using 1 by (meson "qml:2" "vdash-properties:10" "vdash-properties:1[2]")
6802      ultimately AOT_show ιx(A!x & F (x[F]  φ{G}))[G]  φ{G}
6803        using "deduction-theorem" "≡I" by simp
6804    }
6805  qed
6806  ultimately AOT_show (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G}) using "→E" by blast
6807qed
6808
6809definition rigid_condition where rigid_condition φ  v . [v  α (φ{α}  φ{α})]
6810syntax rigid_condition :: ‹id_position  AOT_prop› ("RIGID'_CONDITION'(_')")
6811
6812AOT_theorem "strict-can:1[E]": assumes RIGID_CONDITION(φ)
6813  shows α (φ{α}  φ{α})
6814  using assms[unfolded rigid_condition_def] by auto
6815
6816AOT_theorem "strict-can:1[I]":
6817  assumes  α (φ{α}  φ{α})
6818  shows RIGID_CONDITION(φ)
6819  using assms rigid_condition_def by auto
6820
6821AOT_theorem "box-phi-a:1": assumes RIGID_CONDITION(φ)
6822  shows (A!x  & F (x[F]  φ{F}))  (A!x & F (x[F]  φ{F}))
6823proof (rule "→I")
6824  AOT_assume a: A!x & F (x[F]  φ{F})
6825  AOT_hence b: A!x by (metis "Conjunction Simplification"(1) "oa-facts:2" "vdash-properties:10")
6826  AOT_have x[F]  φ{F} for F using a[THEN "&E"(2)] "∀E" by blast
6827  moreover AOT_have (x[F]  x[F]) for F by (meson "pre-en-eq:1[1]" RN)
6828  moreover AOT_have (φ{F}  φ{F}) for F using RN "strict-can:1[E]"[OF assms] "∀E" by blast
6829  ultimately AOT_have (x[F]  φ{F}) for F
6830    by (metis "&I" "sc-eq-box-box:5" "vdash-properties:6")
6831  AOT_hence F (x[F]  φ{F}) by (rule GEN)
6832  AOT_hence F (x[F]  φ{F}) by (rule BF[THEN "→E"])
6833  AOT_thus ([A!]x & F (x[F]  φ{F}))
6834    using b "KBasic:3" "≡S"(1) "≡E"(2) by blast
6835qed
6836
6837AOT_theorem "box-phi-a:2": assumes RIGID_CONDITION(φ)
6838  shows y = ιx(A!x & F (x[F]  φ{F}))  (A!y & F (y[F]  φ{F}))
6839proof(rule "→I")
6840  AOT_assume y = ιx(A!x & F (x[F]  φ{F}))
6841  AOT_hence 𝒜(A!y & F (y[F]  φ{F})) using "actual-desc:2"[THEN "→E"] by fast
6842  AOT_hence abs: 𝒜A!y and 𝒜F (y[F]  φ{F})
6843    using "Act-Basic:2" "&E" "≡E"(1) by blast+
6844  AOT_hence F 𝒜(y[F]  φ{F}) by (metis "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]")
6845  AOT_hence 𝒜(y[F]  φ{F}) for F using "∀E" by blast
6846  AOT_hence 𝒜y[F]  𝒜φ{F} for F by (metis "Act-Basic:5" "≡E"(1)) 
6847  AOT_hence y[F]  φ{F} for F
6848    using "sc-eq-fur:2"[THEN "→E", OF "strict-can:1[E]"[OF assms, THEN "∀E"(2)[where β=F], THEN RN]]
6849    by (metis "en-eq:10[1]" "≡E"(6))
6850  AOT_hence F (y[F]  φ{F}) by (rule GEN)
6851  AOT_thus [A!]y & F (y[F]  φ{F}) using abs "&I" "≡E"(2) "oa-facts:8" by blast
6852qed
6853
6854AOT_theorem "box-phi-a:3": assumes RIGID_CONDITION(φ)
6855  shows ιx(A!x & F (x[F]  φ{F}))[G]  φ{G}
6856  using "desc-nec-encode" 
6857    "sc-eq-fur:2"[THEN "→E", OF "strict-can:1[E]"[OF assms, THEN "∀E"(2)[where β=G], THEN RN]]
6858    "≡E"(5) by blast
6859
6860AOT_define Null :: ‹τ  φ› ("Null'(_')") 
6861  "df-null-uni:1": Null(x) df A!x & ¬F x[F]
6862
6863AOT_define Universal :: ‹τ  φ› ("Universal'(_')")
6864  "df-null-uni:2": Universal(x) df A!x & F x[F]
6865
6866AOT_theorem "null-uni-uniq:1": ∃!x Null(x)
6867proof (rule "uniqueness:1"[THEN "≡dfI"])
6868  AOT_obtain a where a_prop: A!a & F (a[F]  ¬(F = F))
6869    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
6870  AOT_have a_null: ¬a[F] for F
6871  proof (rule "raa-cor:2")
6872    AOT_assume a[F]
6873    AOT_hence ¬(F = F) using a_prop[THEN "&E"(2)] "∀E" "≡E" by blast
6874    AOT_hence F = F & ¬(F = F) by (metis "id-eq:1" "raa-cor:3")
6875    AOT_thus p & ¬p for p  by (metis "raa-cor:1")
6876  qed
6877  AOT_have Null(a) & β (Null(β)  β = a)
6878  proof (rule "&I")
6879    AOT_have ¬F a[F] using a_null by (metis "instantiation" "reductio-aa:1")
6880    AOT_thus Null(a)
6881      using "df-null-uni:1"[THEN "≡dfI"] a_prop[THEN "&E"(1)] "&I" by metis
6882  next
6883    AOT_show β (Null(β)  β = a)
6884    proof (rule GEN; rule "→I")
6885      fix β
6886      AOT_assume a: Null(β)
6887      AOT_hence ¬F β[F]
6888        using "df-null-uni:1"[THEN "≡dfE"] "&E" by blast
6889      AOT_hence β_null: ¬β[F] for F by (metis "existential:2[const_var]" "reductio-aa:1")
6890      AOT_have F (β[F]  a[F])
6891        apply (rule GEN; rule "≡I"; rule CP)
6892        using "raa-cor:3" β_null a_null by blast+
6893      moreover AOT_have A!β using a "df-null-uni:1"[THEN "≡dfE"] "&E" by blast
6894      ultimately AOT_show β = a
6895        using a_prop[THEN "&E"(1)] "ab-obey:1"[THEN "→E", THEN "→E"] "&I" by blast
6896    qed
6897  qed
6898  AOT_thus α (Null(α) & β (Null(β)  β = α)) using "∃I"(2) by fast
6899qed
6900
6901AOT_theorem "null-uni-uniq:2": ∃!x Universal(x)
6902proof (rule "uniqueness:1"[THEN "≡dfI"])
6903  AOT_obtain a where a_prop: A!a & F (a[F]  F = F)
6904    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
6905  AOT_hence aF: a[F] for F using "&E" "∀E" "≡E" "id-eq:1" by fast
6906  AOT_hence Universal(a)
6907    using "df-null-uni:2"[THEN "≡dfI"] "&I" a_prop[THEN "&E"(1)] GEN by blast
6908  moreover AOT_have β (Universal(β)  β = a)
6909  proof (rule GEN; rule "→I")
6910    fix β
6911    AOT_assume Universal(β)
6912    AOT_hence abs_β: A!β and β[F] for F using "df-null-uni:2"[THEN "≡dfE"] "&E" "∀E" by blast+
6913    AOT_hence β[F]  a[F] for F using aF by (metis "deduction-theorem" "≡I")
6914    AOT_hence F (β[F]  a[F]) by (rule GEN)
6915    AOT_thus β = a
6916      using a_prop[THEN "&E"(1)] "ab-obey:1"[THEN "→E", THEN "→E"] "&I" abs_β by blast
6917  qed
6918  ultimately AOT_show α (Universal(α) & β (Universal(β)  β = α))
6919    using "&I" "∃I" by fast
6920qed
6921
6922AOT_theorem "null-uni-uniq:3": ιx Null(x)
6923  using "A-Exists:2" "RA[2]" "≡E"(2) "null-uni-uniq:1" by blast
6924
6925AOT_theorem "null-uni-uniq:4": ιx Universal(x)
6926  using "A-Exists:2" "RA[2]" "≡E"(2) "null-uni-uniq:2" by blast
6927
6928AOT_define Null_object :: ‹κs (a)
6929  "df-null-uni-terms:1": a =df ιx Null(x)
6930
6931AOT_define Universal_object :: ‹κs (aV)
6932  "df-null-uni-terms:2": aV =df ιx Universal(x)
6933
6934AOT_theorem "null-uni-facts:1": Null(x)  Null(x)
6935proof (rule "→I")
6936  AOT_assume Null(x)
6937  AOT_hence x_abs: A!x and x_null: ¬F x[F]
6938    using "df-null-uni:1"[THEN "≡dfE"] "&E" by blast+
6939  AOT_have ¬x[F] for F using x_null
6940    using "existential:2[const_var]" "reductio-aa:1"
6941    by metis
6942  AOT_hence ¬x[F] for F by (metis "en-eq:7[1]" "≡E"(1))
6943  AOT_hence F ¬x[F] by (rule GEN)
6944  AOT_hence F ¬x[F] by (rule BF[THEN "→E"])
6945  moreover AOT_have F ¬x[F]  ¬F x[F]
6946    apply (rule RM)
6947    by (metis (full_types) "instantiation" "cqt:2[const_var]" "deduction-theorem"
6948                           "reductio-aa:1" "rule-ui:1" "vdash-properties:1[2]")
6949  ultimately AOT_have ¬F x[F]
6950    by (metis "→E")
6951  moreover AOT_have A!x using x_abs
6952    using "oa-facts:2" "vdash-properties:10" by blast
6953  ultimately AOT_have r: (A!x & ¬F x[F])
6954    by (metis "KBasic:3" "&I" "≡E"(3) "raa-cor:3")
6955  AOT_show Null(x)
6956    by (AOT_subst "«Null(x)»" "«A!x & ¬F x[F]»")
6957       (auto simp: "df-null-uni:1" "≡Df" r)
6958qed  
6959
6960AOT_theorem "null-uni-facts:2": Universal(x)  Universal(x)
6961proof (rule "→I")
6962  AOT_assume Universal(x)
6963  AOT_hence x_abs: A!x and x_univ: F x[F]
6964    using "df-null-uni:2"[THEN "≡dfE"] "&E" by blast+
6965  AOT_have x[F] for F using x_univ "∀E" by blast
6966  AOT_hence x[F] for F by (metis "en-eq:2[1]" "≡E"(1))
6967  AOT_hence F x[F] by (rule GEN)
6968  AOT_hence F x[F] by (rule BF[THEN "→E"])
6969  moreover AOT_have A!x using x_abs
6970    using "oa-facts:2" "vdash-properties:10" by blast
6971  ultimately AOT_have r: (A!x & F x[F])
6972    by (metis "KBasic:3" "&I" "≡E"(3) "raa-cor:3")
6973  AOT_show Universal(x)
6974    by (AOT_subst "«Universal(x)»" "«A!x & F x[F]»")
6975       (auto simp add: "df-null-uni:2" "≡Df" r)
6976qed
6977
6978AOT_theorem "null-uni-facts:3": Null(a)
6979  apply (rule "=dfI"(2)[OF "df-null-uni-terms:1"])
6980   apply (simp add: "null-uni-uniq:3")
6981  using "actual-desc:4"[THEN "→E", OF "null-uni-uniq:3"]
6982    "sc-eq-fur:2"[THEN "→E", OF "null-uni-facts:1"[unvarify x, THEN RN, OF "null-uni-uniq:3"], THEN "≡E"(1)]
6983  by blast
6984
6985AOT_theorem "null-uni-facts:4": Universal(aV)
6986  apply (rule "=dfI"(2)[OF "df-null-uni-terms:2"])
6987   apply (simp add: "null-uni-uniq:4")
6988  using "actual-desc:4"[THEN "→E", OF "null-uni-uniq:4"]
6989    "sc-eq-fur:2"[THEN "→E", OF "null-uni-facts:2"[unvarify x, THEN RN, OF "null-uni-uniq:4"], THEN "≡E"(1)]
6990  by blast
6991
6992AOT_theorem "null-uni-facts:5": a  aV
6993proof (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"];
6994    rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"];
6995    rule "≡dfI"[OF "=-infix"];
6996    rule "raa-cor:2")
6997  AOT_obtain x where nullx: Null(x)
6998    by (metis "instantiation" "df-null-uni-terms:1" "existential:1" "null-uni-facts:3"
6999              "null-uni-uniq:3" "rule-id-def:2:b[zero]")
7000  AOT_hence act_null: 𝒜Null(x) by (metis "nec-imp-act" "null-uni-facts:1" "vdash-properties:10")
7001  AOT_assume ιx Null(x) = ιx Universal(x)
7002  AOT_hence 𝒜x(Null(x)  Universal(x))
7003    using "actual-desc:5"[THEN "→E"] by blast
7004  AOT_hence x 𝒜(Null(x)  Universal(x))
7005    by (metis "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]")
7006  AOT_hence 𝒜Null(x)  𝒜Universal(x)
7007    using "Act-Basic:5" "≡E"(1) "rule-ui:3" by blast
7008  AOT_hence 𝒜Universal(x) using act_null "≡E" by blast
7009  AOT_hence Universal(x) by (metis RN "≡E"(1) "null-uni-facts:2" "sc-eq-fur:2" "vdash-properties:10")
7010  AOT_hence F x[F] using "≡dfE"[OF "df-null-uni:2"] "&E" by metis
7011  moreover AOT_have ¬F x[F] using nullx "≡dfE"[OF "df-null-uni:1"] "&E" by metis
7012  ultimately AOT_show p & ¬p for p by (metis "cqt-further:1" "raa-cor:3" "vdash-properties:10")
7013qed
7014
7015AOT_theorem "null-uni-facts:6": a = ιx(A!x & F (x[F]  F  F))
7016proof (rule "ab-obey:1"[unvarify x y, THEN "→E", THEN "→E"])
7017  AOT_show ιx([A!]x & F (x[F]  F  F))
7018    by (simp add: "A-descriptions")
7019next
7020  AOT_show a
7021    by (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"])
7022       (simp add: "null-uni-uniq:3")
7023next
7024  AOT_have ιx([A!]x & F (x[F]  F  F))
7025    by (simp add: "A-descriptions")
7026  AOT_hence 1: ιx([A!]x & F (x[F]  F  F)) = ιx([A!]x & F (x[F]  F  F))
7027    using "rule=I:1" by blast
7028  AOT_show [A!]a & [A!]ιx([A!]x & F (x[F]  F  F))
7029    apply (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"]; rule "&I")
7030    apply (meson "≡dfE" "Conjunction Simplification"(1) "df-null-uni:1" "df-null-uni-terms:1" "null-uni-facts:3" "null-uni-uniq:3" "rule-id-def:2:a[zero]" "vdash-properties:10")
7031    using "can-ab2"[unvarify y, OF "A-descriptions", THEN "→E", OF 1].
7032next
7033  AOT_show F (a[F]  ιx([A!]x & F (x[F]  F  F))[F])
7034  proof (rule GEN)
7035    fix F
7036    AOT_have ¬a[F]
7037      by (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"])
7038         (metis (no_types, lifting) "≡dfE" "&E"(2) "∨I"(2) "∨E"(3)
7039                "df-null-uni:1" "df-null-uni-terms:1" "existential:2[const_var]" "null-uni-facts:3"
7040                "raa-cor:2" "rule-id-def:2:a[zero]" "russell-axiom[enc,1].ψ_denotes_asm")
7041    moreover AOT_have ¬ιx([A!]x & F (x[F]  F  F))[F]
7042    proof(rule "raa-cor:2")
7043      AOT_assume 0: ιx([A!]x & F (x[F]  F  F))[F]
7044      AOT_hence 𝒜(F  F) using "desc-nec-encode"[THEN "≡E"(1), OF 0] by blast
7045      moreover AOT_have ¬𝒜(F  F)
7046        using "≡dfE" "id-act:2" "id-eq:1" "≡E"(2) "=-infix" "raa-cor:3" by blast
7047      ultimately AOT_show 𝒜(F  F) & ¬𝒜(F  F) by (rule "&I")
7048    qed
7049    ultimately AOT_show a[F]  ιx([A!]x & F (x[F]  F  F))[F]
7050      using "deduction-theorem" "≡I" "raa-cor:4" by blast
7051  qed
7052qed
7053
7054AOT_theorem "null-uni-facts:7": aV = ιx(A!x & F (x[F]  F = F))
7055proof (rule "ab-obey:1"[unvarify x y, THEN "→E", THEN "→E"])
7056  AOT_show ιx([A!]x & F (x[F]  F = F))
7057    by (simp add: "A-descriptions")
7058next
7059  AOT_show aV
7060    by (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"])
7061       (simp add: "null-uni-uniq:4")
7062next
7063  AOT_have ιx([A!]x & F (x[F]  F = F))
7064    by (simp add: "A-descriptions")
7065  AOT_hence 1: ιx([A!]x & F (x[F]  F = F)) = ιx([A!]x & F (x[F]  F = F))
7066    using "rule=I:1" by blast
7067  AOT_show [A!]aV & [A!]ιx([A!]x & F (x[F]  F = F))
7068    apply (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"]; rule "&I")
7069    apply (meson "≡dfE" "Conjunction Simplification"(1) "df-null-uni:2" "df-null-uni-terms:2" "null-uni-facts:4" "null-uni-uniq:4" "rule-id-def:2:a[zero]" "vdash-properties:10")
7070    using "can-ab2"[unvarify y, OF "A-descriptions", THEN "→E", OF 1].
7071next
7072  AOT_show F (aV[F]  ιx([A!]x & F (x[F]  F = F))[F])
7073  proof (rule GEN)
7074    fix F
7075    AOT_have aV[F]
7076      apply (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"])
7077      using "≡dfE" "&E"(2) "df-null-uni:2" "df-null-uni-terms:2" "null-uni-facts:4" "null-uni-uniq:4" "rule-id-def:2:a[zero]" "rule-ui:3" by blast
7078    moreover AOT_have ιx([A!]x & F (x[F]  F = F))[F]
7079      using "RA[2]" "desc-nec-encode" "id-eq:1" "≡E"(2) by fastforce
7080    ultimately AOT_show aV[F]  ιx([A!]x & F (x[F]  F = F))[F]
7081      using "deduction-theorem" "≡I" by simp
7082  qed
7083qed
7084
7085AOT_theorem "aclassical:1": Rxy(A!x & A!y & x  y & z [R]zx] = z [R]zy])
7086proof(rule GEN)
7087  fix R
7088  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]zy] & ¬y[F]))
7089    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7090  AOT_have a_enc: az [R]za]
7091  proof (rule "raa-cor:1")
7092    AOT_assume 0: ¬az [R]za]
7093    AOT_hence ¬y(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7094      by (rule a_prop[THEN "&E"(2), THEN "∀E"(1)[where τ="«z [R]za]»"],
7095                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated])
7096         "cqt:2[lambda]"
7097    AOT_hence y ¬(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7098      using "cqt-further:4" "vdash-properties:10" by blast
7099    AOT_hence ¬(A!a & z [R]za] = z [R]za] & ¬az [R]za]) using "∀E" by blast
7100    AOT_hence (A!a & z [R]za] = z [R]za])  az [R]za]
7101      by (metis "&I" "deduction-theorem" "raa-cor:3")
7102    moreover AOT_have z [R]za] = z [R]za]
7103      by (rule "=I") "cqt:2[lambda]"
7104    ultimately AOT_have az [R]za] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7105    AOT_thus az [R]za] & ¬az [R]za]
7106      using 0 "&I" by blast
7107  qed
7108  AOT_hence y(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7109    by (rule a_prop[THEN "&E"(2), THEN "∀E"(1), THEN "≡E"(1), rotated]) "cqt:2[lambda]"
7110  then AOT_obtain b where b_prop: A!b & z [R]za] = z [R]zb] & ¬bz [R]za]
7111    using "∃E"[rotated] by blast
7112  AOT_have a  b
7113    apply (rule "≡dfI"[OF "=-infix"])
7114    using a_enc b_prop[THEN "&E"(2)]
7115    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7116  AOT_hence A!a & A!b & a  b & z [R]za] = z [R]zb]
7117    using b_prop "&E" a_prop "&I" by meson
7118  AOT_hence y (A!a & A!y & a  y & z [R]za] = z [R]zy]) by (rule "∃I")
7119  AOT_thus xy (A!x & A!y & x  y & z [R]zx] = z [R]zy]) by (rule "∃I")
7120qed
7121
7122AOT_theorem "aclassical:2": Rxy(A!x & A!y & x  y & z [R]xz] = z [R]yz])
7123proof(rule GEN)
7124  fix R
7125  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]yz] & ¬y[F]))
7126    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7127  AOT_have a_enc: az [R]az]
7128  proof (rule "raa-cor:1")
7129    AOT_assume 0: ¬az [R]az]
7130    AOT_hence ¬y(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7131      by (rule a_prop[THEN "&E"(2), THEN "∀E"(1)[where τ="«z [R]az]»"],
7132                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated])
7133         "cqt:2[lambda]"
7134    AOT_hence y ¬(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7135      using "cqt-further:4" "vdash-properties:10" by blast
7136    AOT_hence ¬(A!a & z [R]az] = z [R]az] & ¬az [R]az]) using "∀E" by blast
7137    AOT_hence (A!a & z [R]az] = z [R]az])  az [R]az]
7138      by (metis "&I" "deduction-theorem" "raa-cor:3")
7139    moreover AOT_have z [R]az] = z [R]az]
7140      by (rule "=I") "cqt:2[lambda]"
7141    ultimately AOT_have az [R]az] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7142    AOT_thus az [R]az] & ¬az [R]az]
7143      using 0 "&I" by blast
7144  qed
7145  AOT_hence y(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7146    by (rule a_prop[THEN "&E"(2), THEN "∀E"(1), THEN "≡E"(1), rotated]) "cqt:2[lambda]"
7147  then AOT_obtain b where b_prop: A!b & z [R]az] = z [R]bz] & ¬bz [R]az]
7148    using "∃E"[rotated] by blast
7149  AOT_have a  b
7150    apply (rule "≡dfI"[OF "=-infix"])
7151    using a_enc b_prop[THEN "&E"(2)]
7152    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7153  AOT_hence A!a & A!b & a  b & z [R]az] = z [R]bz]
7154    using b_prop "&E" a_prop "&I" by meson
7155  AOT_hence y (A!a & A!y & a  y & z [R]az] = z [R]yz]) by (rule "∃I")
7156  AOT_thus xy (A!x & A!y & x  y & z [R]xz] = z [R]yz]) by (rule "∃I")
7157qed
7158
7159AOT_theorem "aclassical:3": Fxy(A!x & A!y & x  y &  [F]x] =  [F]y])
7160proof(rule GEN)
7161  fix R
7162  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]y] & ¬y[F]))
7163    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7164  AOT_have z [R]a] by "cqt:2[lambda]"
7165  (* TODO: S should no longer be necessary *)
7166  then AOT_obtain S where S_def: S = z [R]a]
7167    by (metis "instantiation" "rule=I:1" "existential:1" id_sym)
7168  AOT_have a_enc: a[S]
7169  proof (rule "raa-cor:1")
7170    AOT_assume 0: ¬a[S]
7171    AOT_hence ¬y(A!y & S = z [R]y] & ¬y[S])
7172      by (rule a_prop[THEN "&E"(2), THEN "∀E"(2)[where β=S],
7173                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated]) 
7174    AOT_hence y ¬(A!y & S = z [R]y] & ¬y[S])
7175      using "cqt-further:4" "vdash-properties:10" by blast
7176    AOT_hence ¬(A!a & S = z [R]a] & ¬a[S]) using "∀E" by blast
7177    AOT_hence (A!a & S = z [R]a])  a[S]
7178      by (metis "&I" "deduction-theorem" "raa-cor:3")
7179    moreover AOT_have S = z [R]a] using S_def .
7180    ultimately AOT_have a[S] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7181    AOT_thus az [R]a] & ¬az [R]a]  by (metis "0" "raa-cor:3") 
7182  qed
7183  AOT_hence y(A!y & S = z [R]y] & ¬y[S])
7184    by (rule a_prop[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1), rotated])
7185  then AOT_obtain b where b_prop: A!b & S = z [R]b] & ¬b[S]
7186    using "∃E"[rotated] by blast
7187  AOT_have 1: a  b
7188    apply (rule "≡dfI"[OF "=-infix"])
7189    using a_enc b_prop[THEN "&E"(2)]
7190    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7191  AOT_have a:  [R]a] = ([R]a)
7192    apply (rule "lambda-predicates:3[zero]"[axiom_inst, unvarify p])
7193    by (meson "log-prop-prop:2")
7194  AOT_have b:  [R]b] = ([R]b)
7195    apply (rule "lambda-predicates:3[zero]"[axiom_inst, unvarify p])
7196    by (meson "log-prop-prop:2")
7197  AOT_have  [R]a] =  [R]b]
7198    apply (rule "rule=E"[rotated, OF a[THEN id_sym]])
7199    apply (rule "rule=E"[rotated, OF b[THEN id_sym]])
7200    apply (rule "identity:4"[THEN "≡dfI", OF "&I", rotated])
7201     apply (rule "rule=E"[rotated, OF S_def])
7202    using b_prop "&E" apply blast
7203    apply (safe intro!: "&I")
7204    by (simp add: "log-prop-prop:2")+
7205  AOT_hence A!a & A!b & a  b &  [R]a] =  [R]b]
7206    using 1 a_prop[THEN "&E"(1)] b_prop[THEN "&E"(1), THEN "&E"(1)] "&I" by auto
7207  AOT_hence y (A!a & A!y & a  y &  [R]a] =  [R]y]) by (rule "∃I")
7208  AOT_thus xy (A!x & A!y & x  y &  [R]x] =  [R]y]) by (rule "∃I")
7209qed
7210
7211AOT_theorem aclassical2: xy (A!x & A!y & x  y & F ([F]x  [F]y))
7212proof -
7213  AOT_have x y ([A!]x & [A!]y & x  y &
7214               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7215    by (rule "aclassical:1"[THEN "∀E"(1)[where τ="«xy F ([F]x  [F]y)]»"]])
7216       "cqt:2[lambda]"
7217  then AOT_obtain x where y ([A!]x & [A!]y & x  y &
7218               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7219    using "∃E"[rotated] by blast
7220  then AOT_obtain y where 0: ([A!]x & [A!]y & x  y &
7221               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7222    using "∃E"[rotated] by blast
7223  AOT_have z xy F ([F]x  [F]y)]zx]x
7224    apply (rule "β←C"(1))
7225      apply "cqt:2[lambda]"
7226     apply (fact "cqt:2[const_var]"[axiom_inst])
7227    apply (rule "β←C"(1))
7228      apply "cqt:2[lambda]"
7229    apply (simp add: "&I" "ex:1:a" prod_denotesI "rule-ui:3")
7230    by (simp add: "oth-class-taut:3:a" "universal-cor")
7231  AOT_hence z xy F ([F]x  [F]y)]zy]x
7232    by (rule "rule=E"[rotated, OF 0[THEN "&E"(2)]])
7233  AOT_hence xy F ([F]x  [F]y)]xy
7234    by (rule "β→C"(1))
7235  AOT_hence F ([F]x  [F]y)
7236    using "β→C"(1) old.prod.case by fast
7237  AOT_hence [A!]x & [A!]y & x  y & F ([F]x  [F]y) using 0 "&E" "&I" by blast
7238  AOT_hence y ([A!]x & [A!]y & x  y & F ([F]x  [F]y)) by (rule "∃I")
7239  AOT_thus xy ([A!]x & [A!]y & x  y & F ([F]x  [F]y)) by (rule "∃I"(2))
7240qed
7241
7242AOT_theorem "kirchner-thm:1": x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7243proof(rule "≡I"; rule "→I")
7244  AOT_assume x φ{x}]
7245  AOT_hence x φ{x}] by (metis "exist-nec" "vdash-properties:10")
7246  moreover AOT_have x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7247  proof (rule "RM:1"; rule "→I"; rule GEN; rule GEN; rule "→I")
7248    AOT_modally_strict {
7249      fix x y
7250      AOT_assume 0: x φ{x}]
7251      moreover AOT_assume F([F]x  [F]y)
7252      ultimately AOT_have x φ{x}]x  x φ{x}]y
7253        using "∀E" by blast
7254      AOT_thus (φ{x}  φ{y})
7255        using "beta-C-meta"[THEN "→E", OF 0] "≡E"(6) by meson
7256    }
7257  qed
7258  ultimately AOT_show xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7259    using "→E" by blast
7260next
7261  AOT_have xy(F([F]x  [F]y)  (φ{x}  φ{y}))  y(x(F([F]x  [F]y) & φ{x})  φ{y})
7262  proof(rule "RM:1"; rule "→I"; rule GEN)
7263    AOT_modally_strict {
7264      AOT_assume xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7265      AOT_hence indisc: φ{x}  φ{y} if F([F]x  [F]y) for x y
7266        using "∀E"(2) "→E" that by blast
7267      AOT_show (x(F([F]x  [F]y) & φ{x})  φ{y}) for y
7268      proof (rule "raa-cor:1")
7269        AOT_assume ¬(x(F([F]x  [F]y) & φ{x})  φ{y})
7270        AOT_hence (x(F([F]x  [F]y) & φ{x}) & ¬φ{y})  (¬(x(F([F]x  [F]y) & φ{x})) & φ{y})
7271          using "≡E"(1) "oth-class-taut:4:h" by blast
7272        moreover {
7273          AOT_assume 0: x(F([F]x  [F]y) & φ{x}) & ¬φ{y}
7274          AOT_obtain a where F([F]a  [F]y) & φ{a}
7275            using "∃E"[rotated, OF 0[THEN "&E"(1)]]  by blast
7276          AOT_hence φ{y} using indisc[THEN "≡E"(1)] "&E" by blast
7277          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7278        }
7279        moreover {
7280          AOT_assume 0: (¬(x(F([F]x  [F]y) & φ{x})) & φ{y})
7281          AOT_hence x ¬(F([F]x  [F]y) & φ{x})
7282            using "&E"(1) "cqt-further:4" "→E" by blast
7283          AOT_hence ¬(F([F]y  [F]y) & φ{y}) using "∀E" by blast
7284          AOT_hence ¬F([F]y  [F]y)  ¬φ{y}
7285            using "≡E"(1) "oth-class-taut:5:c" by blast
7286          moreover AOT_have F([F]y  [F]y) by (simp add: "oth-class-taut:3:a" "universal-cor")
7287          ultimately AOT_have ¬φ{y} by (metis "¬¬I" "∨E"(2))
7288          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7289        }
7290        ultimately AOT_show p & ¬p for p using "∨E"(3) "raa-cor:1" by blast
7291      qed
7292    }
7293  qed
7294  moreover AOT_assume xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7295  ultimately AOT_have y(x(F([F]x  [F]y) & φ{x})  φ{y})
7296    using "→E" by blast
7297  AOT_thus x φ{x}]
7298    by (rule "safe-ext"[axiom_inst, THEN "→E", OF "&I", rotated]) "cqt:2[lambda]"
7299qed
7300
7301AOT_theorem "kirchner-thm:2": x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7302proof(rule "≡I"; rule "→I")
7303  AOT_assume x1...xn φ{x1...xn}]
7304  AOT_hence x1...xn φ{x1...xn}] by (metis "exist-nec" "vdash-properties:10")
7305  moreover AOT_have x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7306  proof (rule "RM:1"; rule "→I"; rule GEN; rule GEN; rule "→I")
7307    AOT_modally_strict {
7308      fix x1xn y1yn :: 'a AOT_var›
7309      AOT_assume 0: x1...xn φ{x1...xn}]
7310      moreover AOT_assume F([F]x1...xn  [F]y1...yn)
7311      ultimately AOT_have x1...xn φ{x1...xn}]x1...xn  x1...xn φ{x1...xn}]y1...yn
7312        using "∀E" by blast
7313      AOT_thus (φ{x1...xn}  φ{y1...yn})
7314        using "beta-C-meta"[THEN "→E", OF 0] "≡E"(6) by meson
7315    }
7316  qed
7317  ultimately AOT_show x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7318    using "→E" by blast
7319next
7320  AOT_have (x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))) 
7321            y1...∀yn((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7322  proof(rule "RM:1"; rule "→I"; rule GEN)
7323    AOT_modally_strict {
7324      AOT_assume x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7325      AOT_hence indisc: φ{x1...xn}  φ{y1...yn} if F([F]x1...xn  [F]y1...yn) for x1xn y1yn
7326        using "∀E"(2) "→E" that by blast
7327      AOT_show (x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn} for y1yn
7328      proof (rule "raa-cor:1")
7329        AOT_assume ¬((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7330        AOT_hence ((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & ¬φ{y1...yn}) 
7331                    (¬(x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & φ{y1...yn})
7332          using "≡E"(1) "oth-class-taut:4:h" by blast
7333        moreover {
7334          AOT_assume 0: (x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & ¬φ{y1...yn}
7335          AOT_obtain a1an where F([F]a1...an  [F]y1...yn) & φ{a1...an}
7336            using "∃E"[rotated, OF 0[THEN "&E"(1)]]  by blast
7337          AOT_hence φ{y1...yn} using indisc[THEN "≡E"(1)] "&E" by blast
7338          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7339        }
7340        moreover {
7341          AOT_assume 0: (¬((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))) & φ{y1...yn})
7342          AOT_hence x1...∀xn ¬(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})
7343            using "&E"(1) "cqt-further:4" "→E" by blast
7344          AOT_hence ¬(F([F]y1...yn  [F]y1...yn) & φ{y1...yn}) using "∀E" by blast
7345          AOT_hence ¬F([F]y1...yn  [F]y1...yn)  ¬φ{y1...yn}
7346            using "≡E"(1) "oth-class-taut:5:c" by blast
7347          moreover AOT_have F([F]y1...yn  [F]y1...yn)
7348            by (simp add: "oth-class-taut:3:a" "universal-cor")
7349          ultimately AOT_have ¬φ{y1...yn} by (metis "¬¬I" "∨E"(2))
7350          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7351        }
7352        ultimately AOT_show p & ¬p for p using "∨E"(3) "raa-cor:1" by blast
7353      qed
7354    }
7355  qed
7356  moreover AOT_assume x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7357  ultimately AOT_have y1...∀yn((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7358    using "→E" by blast
7359  AOT_thus x1...xn φ{x1...xn}]
7360    by (rule "safe-ext"[axiom_inst, THEN "→E", OF "&I", rotated]) "cqt:2[lambda]"
7361qed
7362
7363AOT_theorem "kirchner-thm-cor:1": x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7364proof(rule "→I"; rule GEN; rule GEN; rule "→I")
7365  fix x y
7366  AOT_assume x φ{x}]
7367  AOT_hence xy (F ([F]x  [F]y)  (φ{x}  φ{y}))
7368    by (rule "kirchner-thm:1"[THEN "≡E"(1)])
7369  AOT_hence xy (F ([F]x  [F]y)  (φ{x}  φ{y}))
7370    using CBF[THEN "→E"] by blast
7371  AOT_hence y (F ([F]x  [F]y)  (φ{x}  φ{y}))
7372    using "∀E" by blast
7373  AOT_hence y (F ([F]x  [F]y)  (φ{x}  φ{y}))
7374    using CBF[THEN "→E"] by blast
7375  AOT_hence (F ([F]x  [F]y)  (φ{x}  φ{y}))
7376    using "∀E" by blast
7377  AOT_hence F ([F]x  [F]y)  (φ{x}  φ{y})
7378    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7379  moreover AOT_assume F([F]x  [F]y)
7380  ultimately AOT_show (φ{x}  φ{y}) using "→E" "ind-nec" by blast
7381qed
7382
7383AOT_theorem "kirchner-thm-cor:2":
7384  x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7385proof(rule "→I"; rule GEN; rule GEN; rule "→I")
7386  fix x1xn y1yn
7387  AOT_assume x1...xn φ{x1...xn}]
7388  AOT_hence 0: x1...∀xny1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7389    by (rule "kirchner-thm:2"[THEN "≡E"(1)])
7390  AOT_have x1...∀xny1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7391  proof(rule GEN; rule GEN)
7392    fix x1xn y1yn
7393    AOT_show (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7394      apply (rule "RM:1"[THEN "→E", rotated, OF 0]; rule "→I")
7395      using "∀E" by blast
7396  qed
7397  AOT_hence y1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7398    using "∀E" by blast
7399  AOT_hence (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7400    using "∀E" by blast
7401  AOT_hence (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7402    using "∀E" by blast
7403  AOT_hence 0: F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn})
7404    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7405  moreover AOT_assume F([F]x1...xn  [F]y1...yn)
7406  moreover AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)] by "cqt:2[lambda]"
7407  ultimately AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]x1...xn  x1...xn F ([F]x1...xn  [F]y1...yn)]y1...yn
7408    using "∀E" by blast
7409  moreover AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]y1...yn
7410    apply (rule "β←C"(1))
7411      apply "cqt:2[lambda]"
7412     apply (fact "cqt:2[const_var]"[axiom_inst])
7413    by (simp add: RN GEN "oth-class-taut:3:a")
7414  ultimately AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]x1...xn using "≡E"(2) by blast
7415  AOT_hence F ([F]x1...xn  [F]y1...yn)
7416    using "β→C"(1) by blast
7417  AOT_thus (φ{x1...xn}  φ{y1...yn}) using "→E" 0 by blast
7418qed
7419
7420AOT_define propositional :: ‹Π  φ› (Propositional'(_'))
7421  "prop-prop1": Propositional([F]) df p(F = y p])
7422
7423AOT_theorem "prop-prop2:1": p y p]
7424  by (rule GEN) "cqt:2[lambda]"
7425
7426AOT_theorem "prop-prop2:2": ν φ]
7427  by "cqt:2[lambda]"
7428
7429AOT_theorem "prop-prop2:3": F = y p]  x([F]x  p)
7430proof (rule "→I")
7431  AOT_assume 0: F = y p]
7432  AOT_show x([F]x  p)
7433    by (rule "rule=E"[rotated, OF 0[symmetric]]; rule RN; rule GEN; rule "beta-C-meta"[THEN "→E"])
7434      "cqt:2[lambda]"
7435qed
7436
7437AOT_theorem "prop-prop2:4": Propositional([F])  Propositional([F])
7438proof(rule "→I")
7439  AOT_assume Propositional([F])
7440  AOT_hence p(F = y p]) using "≡dfE"[OF "prop-prop1"] by blast
7441  then AOT_obtain p where F = y p] using "∃E"[rotated] by blast
7442  AOT_hence (F = y p]) using "id-nec:2" "modus-tollens:1" "raa-cor:3" by blast
7443  AOT_hence p (F = y p]) using "∃I" by fast
7444  AOT_hence 0: p (F = y p]) by (metis Buridan "vdash-properties:10")
7445  AOT_show Propositional([F])
7446    apply (AOT_subst «Propositional([F])» «p (F = y p])»)
7447     using "prop-prop1" "≡Df" apply presburger
7448    by (fact 0)
7449qed
7450
7451AOT_define indicriminate :: ‹Π  φ› ("Indiscriminate'(_')")
7452  "prop-indis": Indiscriminate([F]) df F & (x [F]x  x [F]x)
7453
7454AOT_theorem "prop-in-thm": Propositional([Π])  Indiscriminate([Π])
7455proof(rule "→I")
7456  AOT_assume Propositional([Π])
7457  AOT_hence p Π = y p] using "≡dfE"[OF "prop-prop1"] by blast
7458  then AOT_obtain p where Π_def: Π = y p] using "∃E"[rotated] by blast
7459  AOT_show Indiscriminate([Π])
7460  proof (rule "≡dfI"[OF "prop-indis"]; rule "&I")
7461    AOT_show Π
7462      using Π_def by (meson "t=t-proper:1" "vdash-properties:6")
7463  next
7464    AOT_show (x [Π]x  x [Π]x)
7465    proof (rule "rule=E"[rotated, OF Π_def[symmetric]]; rule RN; rule "→I"; rule GEN)
7466      AOT_modally_strict {
7467        AOT_assume x y p]x
7468        then AOT_obtain a where y p]a using "∃E"[rotated] by blast
7469        AOT_hence 0: p by (metis "β→C"(1))
7470        AOT_show y p]x for x
7471          apply (rule "β←C"(1))
7472            apply "cqt:2[lambda]"
7473           apply (fact "cqt:2[const_var]"[axiom_inst])
7474          by (fact 0)
7475      }
7476    qed
7477  qed
7478qed
7479
7480AOT_theorem "prop-in-f:1": Necessary([F])  Indiscriminate([F])
7481proof (rule "→I")
7482  AOT_assume Necessary([F])
7483  AOT_hence 0: x1...∀xn [F]x1...xn using "≡dfE"[OF "contingent-properties:1"] by blast
7484  AOT_show Indiscriminate([F])
7485    by (rule "≡dfI"[OF "prop-indis"])
7486       (metis "0" "KBasic:1" "&I" "ex:1:a" "rule-ui:2[const_var]" "vdash-properties:6") 
7487qed
7488
7489AOT_theorem "prop-in-f:2": Impossible([F])  Indiscriminate([F])
7490proof (rule "→I")
7491  AOT_modally_strict {
7492    AOT_have x ¬[F]x  (x [F]x  x [F]x)
7493      by (metis "instantiation" "cqt-orig:3" "Hypothetical Syllogism" "deduction-theorem" "raa-cor:3")
7494  }
7495  AOT_hence 0: x ¬[F]x  (x [F]x  x [F]x)
7496    by (rule "RM:1")
7497  AOT_assume Impossible([F])
7498  AOT_hence x ¬[F]x using "≡dfE"[OF "contingent-properties:2"] "&E" by blast
7499  AOT_hence 1: (x [F]x  x [F]x) using 0 "→E" by blast
7500  AOT_show Indiscriminate([F])
7501    by (rule "≡dfI"[OF "prop-indis"]; rule "&I")
7502       (simp add: "ex:1:a" "rule-ui:2[const_var]" 1)+
7503qed
7504
7505AOT_theorem "prop-in-f:3:a": ¬Indiscriminate([E!])
7506proof(rule "raa-cor:2")
7507  AOT_assume Indiscriminate([E!])
7508  AOT_hence 0: (x [E!]x  x [E!]x)
7509    using "≡dfE"[OF "prop-indis"] "&E" by blast
7510  AOT_hence x [E!]x  x [E!]x
7511    using "KBasic:13" "vdash-properties:10" by blast
7512  moreover AOT_have x [E!]x
7513    by (simp add: "thm-cont-e:3")
7514  ultimately AOT_have x [E!]x
7515    by (metis "vdash-properties:6")
7516  AOT_thus p & ¬p for p
7517    by (metis "≡dfE" "conventions:5" "o-objects-exist:5" "reductio-aa:1")
7518qed
7519
7520AOT_theorem "prop-in-f:3:b": ¬Indiscriminate([E!]-)
7521proof (rule "rule=E"[rotated, OF "rel-neg-T:2"[symmetric]]; rule "raa-cor:2")
7522  AOT_assume Indiscriminate(x ¬[E!]x])
7523  AOT_hence 0: (x x ¬[E!]x]x  x x ¬[E!]x]x)
7524    using "≡dfE"[OF "prop-indis"] "&E" by blast
7525  AOT_hence x x ¬[E!]x]x  x x ¬[E!]x]x
7526    using "→E" "qml:1" "vdash-properties:1[2]" by blast
7527  moreover AOT_have x x ¬[E!]x]x
7528    apply (AOT_subst λκ. «x ¬[E!]x]κ» λκ. «¬[E!]κ»)
7529    apply (rule "beta-C-meta"[THEN "→E"])
7530     apply "cqt:2[lambda]"
7531    by (metis (full_types) "B◇" RN "T◇" "cqt-further:2" "o-objects-exist:5" "vdash-properties:10")
7532  ultimately AOT_have 1: x x ¬[E!]x]x
7533    by (metis "vdash-properties:6")
7534  AOT_have x ¬[E!]x
7535    apply (AOT_subst_rev λκ. «x ¬[E!]x]κ» λκ. «¬[E!]κ»)
7536    apply (rule "beta-C-meta"[THEN "→E"])
7537     apply "cqt:2[lambda]"
7538    by (fact 1)
7539  AOT_hence x ¬[E!]x by (metis "CBF" "vdash-properties:10")
7540  moreover AOT_obtain a where abs_a: O!a
7541    using "instantiation" "o-objects-exist:1" "qml:2" "vdash-properties:1[2]" "vdash-properties:6" by blast
7542  ultimately AOT_have ¬[E!]a using "∀E" by blast
7543  AOT_hence 2: ¬[E!]a by (metis "≡dfE" "conventions:5" "reductio-aa:1")
7544  AOT_have A!a
7545    apply (rule "=dfI"(2)[OF AOT_abstract])
7546     apply "cqt:2[lambda]"
7547    apply (rule "β←C"(1))
7548      apply "cqt:2[lambda]"
7549    using "cqt:2[const_var]"[axiom_inst] apply blast
7550    by (fact 2)
7551  AOT_thus p & ¬p for p using abs_a
7552    by (metis "≡E"(1) "oa-contingent:2" "reductio-aa:1")
7553qed
7554
7555AOT_theorem "prop-in-f:3:c": ¬Indiscriminate(O!)
7556proof(rule "raa-cor:2")
7557  AOT_assume Indiscriminate(O!)
7558  AOT_hence 0: (x O!x  x O!x)
7559    using "≡dfE"[OF "prop-indis"] "&E" by blast
7560  AOT_hence x O!x  x O!x
7561    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7562  moreover AOT_have x O!x
7563    using "o-objects-exist:1" by blast
7564  ultimately AOT_have x O!x
7565    by (metis "vdash-properties:6")
7566  AOT_thus p & ¬p for p
7567    by (metis "o-objects-exist:3" "qml:2" "raa-cor:3" "vdash-properties:10" "vdash-properties:1[2]")
7568qed
7569
7570AOT_theorem "prop-in-f:3:d": ¬Indiscriminate(A!)
7571proof(rule "raa-cor:2")
7572  AOT_assume Indiscriminate(A!)
7573  AOT_hence 0: (x A!x  x A!x)
7574    using "≡dfE"[OF "prop-indis"] "&E" by blast
7575  AOT_hence x A!x  x A!x
7576    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7577  moreover AOT_have x A!x
7578    using "o-objects-exist:2" by blast
7579  ultimately AOT_have x A!x
7580    by (metis "vdash-properties:6")
7581  AOT_thus p & ¬p for p
7582    by (metis "o-objects-exist:4" "qml:2" "raa-cor:3" "vdash-properties:10" "vdash-properties:1[2]")
7583qed
7584
7585AOT_theorem "prop-in-f:4:a": ¬Propositional(E!)
7586  using "modus-tollens:1" "prop-in-f:3:a" "prop-in-thm" by blast
7587
7588AOT_theorem "prop-in-f:4:b": ¬Propositional(E!-)
7589  using "modus-tollens:1" "prop-in-f:3:b" "prop-in-thm" by blast
7590
7591AOT_theorem "prop-in-f:4:c": ¬Propositional(O!)
7592  using "modus-tollens:1" "prop-in-f:3:c" "prop-in-thm" by blast
7593
7594AOT_theorem "prop-in-f:4:d": ¬Propositional(A!)
7595  using "modus-tollens:1" "prop-in-f:3:d" "prop-in-thm" by blast
7596
7597AOT_theorem "prop-prop-nec:1": p (F = y p])  p(F = y p])
7598proof(rule "→I")
7599  AOT_assume p (F = y p])
7600  AOT_hence p (F = y p])
7601    by (metis "BF◇" "vdash-properties:10")
7602  then AOT_obtain p where (F = y p]) using "∃E"[rotated] by blast
7603  AOT_hence F = y p] by (metis "derived-S5-rules:2" emptyE "id-nec:2" "vdash-properties:6")
7604  AOT_thus p(F = y p]) by (rule "∃I")
7605qed
7606
7607AOT_theorem "prop-prop-nec:2": p (F  y p])  p(F  y p])
7608proof(rule "→I")
7609  AOT_assume p (F  y p])
7610  AOT_hence (F  y p]) for p
7611    using "∀E" by blast
7612  AOT_hence (F  y p]) for p
7613    by (rule "id-nec2:2"[unvarify β, THEN "→E", rotated]) "cqt:2[lambda]"
7614  AOT_hence p (F  y p]) by (rule GEN)
7615  AOT_thus p (F  y p]) using BF[THEN "→E"] by fast
7616qed
7617
7618AOT_theorem "prop-prop-nec:3": p (F = y p])  p(F = y p])
7619proof(rule "→I")
7620  AOT_assume p (F = y p])
7621  then AOT_obtain p where (F = y p]) using "∃E"[rotated] by blast
7622  AOT_hence (F = y p]) by (metis "id-nec:2" "vdash-properties:6")
7623  AOT_hence p(F = y p]) by (rule "∃I")
7624  AOT_thus p(F = y p]) by (metis Buridan "vdash-properties:10")
7625qed
7626
7627AOT_theorem "prop-prop-nec:4": p (F  y p])  p(F  y p])
7628proof(rule "→I")
7629  AOT_assume p (F  y p])
7630  AOT_hence p (F  y p]) by (metis "Buridan◇" "vdash-properties:10")
7631  AOT_hence (F  y p]) for p
7632    using "∀E" by blast
7633  AOT_hence F  y p] for p
7634    by (rule "id-nec2:3"[unvarify β, THEN "→E", rotated]) "cqt:2[lambda]"
7635  AOT_thus p (F  y p]) by (rule GEN)
7636qed
7637
7638AOT_theorem "enc-prop-nec:1": F (x[F]  p(F = y p]))  F(x[F]  p (F = y p]))
7639proof(rule "→I"; rule GEN; rule "→I")
7640  fix F
7641  AOT_assume F (x[F]  p(F = y p]))
7642  AOT_hence F (x[F]  p(F = y p]))
7643    using "Buridan◇" "vdash-properties:10" by blast
7644  AOT_hence 0: (x[F]  p(F = y p])) using "∀E" by blast
7645  AOT_assume x[F]
7646  AOT_hence x[F] by (metis "en-eq:2[1]" "≡E"(1))
7647  AOT_hence p(F = y p])
7648    using 0 by (metis "KBasic2:4" "≡E"(1) "vdash-properties:10")
7649  AOT_thus p(F = y p])
7650    using "prop-prop-nec:1"[THEN "→E"] by blast
7651qed
7652
7653AOT_theorem "enc-prop-nec:2": F (x[F]  p(F = y p]))  F(x[F]  p (F = y p]))
7654  using "derived-S5-rules:1"[where Γ="{}", simplified, OF "enc-prop-nec:1"]
7655  by blast
7656
7657(*<*)
7658end
7659(*>*)